I have bound a webcombo to a ultrawebgrid.
webcombo.DataSource = CustomerDataTable;
webCombo.DataTextField = "CustomerName";
webCombo.DataValueField = "CustomerName";
webcombo.DataBind();
I am able to see the webcombo and all the columns associated to it. Can you tell me how to retrieve its value. Like say for example
Customername, city, state, Zip in my webcombo.
How do I retrieve the values of selected city, state from webcombo wile saving it to the database.
If we can retrieve the city and state information, Is there a way to hide the Zip. I just need this value only to save to the database but would not like to show it to the user>
Any suggestions please
Hello,
You can get a reference to the selected values from WebCombo in each event handler I am using button click.
For example:
protected void Button1_Click(object sender, EventArgs e) { //Get the selected row UltraGridRow row = WebCombo1.SelectedRow; //Get the value of first cell from the selected row. string value = row.Cells[0].Value.ToString(); }
When I try to check the same code in
UltraWebGrid_UpdaterowBatchevent
I am getting an exception
"Object reference not set to an instance of an object"
Thanks
I am using master page.
still not able to get it from Update_rowbatchevent
Hi,
This usually happens when there is no selected row to avoid this behavior you can try something like this:
protected void Button1_Click(object sender, EventArgs e) { foreach (UltraGridRow row in WebCombo1.Rows) { //Check whether the row is selected. if (row.Selected) { //Get the value of first cell from the selected row. string value = row.Cells[0].Value.ToString(); } } }