Hello,
I have a page containing a radGrid, wich use a WebUserControl for edition. Inside the WebUserControl I have a bunch of radComboBox, some of them are using WebService for performance.
I notice that you can't set SelectedValue unless the user previously open the comboBox and at the same time, loaded the items, witch kind of makes sens, you can't select a value that is not inside of the comboBox at the selection time. The part that pose a problem is that I need primary key information about the selectedItem to be able to do update/insert and the client don't want to see that inside the text of the comboBox.
So first idea was to use item's attribute, but this feature can't be access server-side when using WebService and can only be set to an item, so no luck.
I then tried to add a custom made item to the comboBox that contain what I need, witch works fine until you try to load the real items...
I then tried to customize the comboBox and override SelectedValue to keep the value inside of a private String and return the custom string when SelectedValue is empty. That mechanism works through post back, everything seems find, until I hit the Save button. The text properties is set properly, but my custom SelectedValue String is empty. Doing some forensic works, I discover that the difference responsible for my custom SelectedValue String absence of value, is that when I press the Save button the DataItem properties of the WebUserControl is set to null, so I can't reassign my custom String.
So what is the proper way to either set SelectedValue when items haven't been loaded or keep hidden primary keys inside the comboBox that will be accessible when performing update/insert?
Thanks for the help,
Louis-Philippe
I have a page containing a radGrid, wich use a WebUserControl for edition. Inside the WebUserControl I have a bunch of radComboBox, some of them are using WebService for performance.
I notice that you can't set SelectedValue unless the user previously open the comboBox and at the same time, loaded the items, witch kind of makes sens, you can't select a value that is not inside of the comboBox at the selection time. The part that pose a problem is that I need primary key information about the selectedItem to be able to do update/insert and the client don't want to see that inside the text of the comboBox.
So first idea was to use item's attribute, but this feature can't be access server-side when using WebService and can only be set to an item, so no luck.
I then tried to add a custom made item to the comboBox that contain what I need, witch works fine until you try to load the real items...
I then tried to customize the comboBox and override SelectedValue to keep the value inside of a private String and return the custom string when SelectedValue is empty. That mechanism works through post back, everything seems find, until I hit the Save button. The text properties is set properly, but my custom SelectedValue String is empty. Doing some forensic works, I discover that the difference responsible for my custom SelectedValue String absence of value, is that when I press the Save button the DataItem properties of the WebUserControl is set to null, so I can't reassign my custom String.
So what is the proper way to either set SelectedValue when items haven't been loaded or keep hidden primary keys inside the comboBox that will be accessible when performing update/insert?
Thanks for the help,
Louis-Philippe