Hi all,
I have developed a windows form application in which I have used Infragistics' UltraGrid Control. I have populated the grid by binding the data at run-time with a dataset. I have a dropdown column in my grid and I have used an event handler for that column once the value is changed from the dropdown(celllist_select event). Now I need to make some particular cells of the row which I have selected(ActiveRow) as editable, once the dropdownlist item is changed. I will just give a tabular representation of my requirement.
Now in this table, as you can see I have a column called "Formula" which is a dropdownlist column containing items such as Linear,Manual,Bell Curve,etc; In the second row, I have selected the formula as Manual. So, once I select Manual, I want all the projected values of the 2nd row alone to be editable. Rest of the cells shouldn't be editable. How to achieve this? I don't want to use initializelayout to achieve this functionality. Any help rendered would be of great use.
Hi,
You have to call the below code while initializing the grid.
<igtbl:UltraWebGrid ID="GridName" runat="server" AutoGenerateColumns="false" DisplayLayout-ActivationObject-BorderColor="Black" DisplayLayout-ActivationObject-BorderStyle='Solid' oninitializerow="GridName_InitializeRow" >
Write the following code in code behind.
protected
void GridName_InitializeRow( object sender, Infragistics.WebUI.UltraWebGrid. RowEventArgs e)
{
for ( int i = 0; i <= e.Row.Cells.Count-1; i++)
if (i > 9)
//editing paricular cell
e.Row.Cells[i].AllowEditing = Infragistics.WebUI.UltraWebGrid.
.Yes;
e.Row.Cells[i].Style.BackColor = System.Drawing.
// "white";
}
else
.No;
Hope.it helps :-)
GnanaPrakash