Hi
i have ultragrid ,ultradropdown attached to the one column.if i selected some text from the dropdown iam getting valuemember value (ID) in afterupdate row event.if i did not select anything in dropdown list it is giving dispaly text in after row update event.
can u any one help on this
When the column's Style resolves to 'DropDown', as I believe is the case when youn assign a ComboBox-like editor, the cell's value will be the underlying data value when the text in the edit portion matches one, or the display text itself when that text does not match any items. You can change this by setting the Style property to 'DropDownList' or 'DropDownValidate'; the former prevents typing altogether and the latter restricts typed values to those that match an item in the dropdown list.
i set the column value to the dropdownlist or DropDownValidate.But not solved.Same text values which are filled from datatable not matched with dropdownlist values even though both are same.if i need id values from cell i have to select some text value from the dropdownlist attached to the cell then it shows selected value in blue color.by default when filled from datatable those are not matching with dropdown item values.Anu code added to match both values?
e.Layout.Bands[0].Columns[3].ValueList =
this.ultraDropDown1;
private
void BindUltraDropDown()
{
DataTable dt = new DataTable();
dt.Columns.Add(
"ID", typeof(int));
"DisplayText", typeof(string));
dt.Rows.Add(
new object[] { 0, "A" });
new object[] { 4, "B" });
new object[] { 5, "C" });
new object[] { 1, "A" });
new object[] { 2, "B" });
new object[] { 3, "C" });
dt.AcceptChanges();
this.ultraDropDown1.DataSource = dt;
this.ultraDropDown1.ValueMember = "ID";
this.ultraDropDown1.DisplayMember = "DisplayText";
}
private void BindGrid()
"Dropdo");
"dropdoqwn1");
new object[] { 1, "A", "A", "A" });
new object[] { 2, "B", "A", "A" });
new object[] { 3, "C", "A", "A" });
ultraGrid1.DataSource = dt;
ultraGrid1.DataBind();
What you have here looks like it should work, but it's very difficult to do anything with a code snippet like this, since there are too many unknowns in the project.
Can you post a small sample project that I can run and debug to see the problem? To attach a file to your forum posts, just go to the Options tab.
Hi,
What do I need to do with this sample in order to see a problem occur?
I tried dropping down the list and selecting an item in the first row of the grid. For example, I select "B" and then I move to another Row (or click the button). Your AfterRowUpdate code is getting the value from the DataRow and it correctly returns a 2.
Then I tried the same thing without dropping down the list, but instead I typed a "B" into the cell and clicked the button. Once again, I get the same results. Your code in AfterRowUpdate returns the number 2.
cussions.Components.Files/178/6371.WindowsFormsApplication1.zip:550:0]
i just attached sample application and please help me on this issue.