Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
265
WebCombo as a editor control in webgrid
posted

I am having a webcombo in a ultrawebgrid as editorcontrl for CustomerName column in the grid

 

 

  protected void Grid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.UltraGridEventArgs e)

{

       this.WebCombo1.DataValueField = "CustomerId";

        this.WebCombo1.DataTextField = "CustomerName";

         WebCombo1.DataSource = ds; // ds contains CustomerId, and CustomerName

        WebCombo1.DataBind();

 

 

Grid1.DisplayLayout.Bands[0].Columns.

FromKey("CustomerName").Type = ColumnType.Custom;

Grid1.DisplayLayout.Bands[0].

FromKey("CustomerName").EditorControlID = WebCombo1.UniqueID;

Grid1.DisplayLayout.Bands[0].Columns

.FromKey("CustomerName").ValueList.DisplayStyle = ValueListDisplayStyle.DisplayText;

 

}

 

When I am trying to retrieve the value for "CustomerName", I am getting both same values for text and value, instead of getting "CustomerName" as Text and "CustomerId" as Value. How to retrieve the value of the cell.

 

I am retrieving the values like this

int Customerid =Convert.ToInt32(row.Cells.FromKey("CustomerName").Value);

string CustomerName = row.Cells.FromKey("CustomerName").Text;

 

In both cases, I am getting Customername, not able to retrieve customerId. How to retrieve CustomerId for the Selected Customername in evry row of the grid