Hi
In my grid one column is a combo dropdown. The display member is name(string) and the value member is number(int). i get the data from database.
I can type both name(string) and number(int) in this column and save it. I used celldataerror and before cell update events to achieve this.
My problem is if i type a number and if that exists as in database as value member( since it is a number(int)), the ultracombo is displaying the respective display member of that value member.
But i dont want the ultracombo to display the display member of that value member as i want to save that number as a string in the displymember filed as name.
Can anyone tell me how to remove the automatic display of the display member if we type the value member in ultracombo???
Thanks in advance
Navi
navi519 said:In this event first we will compare the typed name to all the names present in the database. If that name is present dont do anything, else save it to database. :)
In this event first we will compare the typed name to all the names present in the database. If that name is present dont do anything, else save it to database. :)
If the name is not present, you probably don't want to just automatically save it to the database, do you? What if the user types in a number that is not valid?
It seems to me that what you need to do is find the item on the list. You can do this easily enough by calling cell.ValueListResolved.GetText(...). This will return you an index of the item on the list that matches the value you passed in (or -1 if there is no match) and also return you the text of that item. Then you can set the cell.EditorResolved.Text to the text returned. This way, i's as if the user typed in the text instead of the value and the grid can take it from there.
Hi everyone
My solution to the above problem is posted in the previous post. But there is a small problem in that too.
The problem is when we type the name(as number) which is already present in the database as value, then it shows up in the cell for a fraction of second and then the typed the name(as number). The typed name is getting saved in the database, but that name which is related to the value in the database is showing up for that fraction of second is not accepted to me.
Can anyone tell the solution to the above mentioned problem(please read my first post if you dont understand question in this post)
I found work around solution to the above mentioned problem.
We can use ultragrid_BeforeExitEditMode event and solve the above problem