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
360
Getting Event on an UltraWebGrid row
posted

hi

i have a question. Like in Grid View when we add Template Column and add some DropDownList or Checkbox etc. in it then after double clicking on it we get EventHandler for that Control. So we get also index for that row on which Dropdown's selected Index change event has occured.Am i Clear?

 How i can accomplish this thing in UltrWebGrid .

  • 28464
    Verified Answer
    posted

    You can try something similar to: 

    <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" Height="200px" Width="325px"
            DataSourceID="AccessDataSource1" >
            <Bands>
                <igtbl:UltraGridBand>
                    <Columns> 
                        <igtbl:TemplatedColumn>
                            <CellTemplate>
                                <asp:DropDownList
                                    runat="server"
                                    ID="DropDownList1"
                                    OnInit="DropDownList1_OnInit">
                                </asp:DropDownList>
                            </CellTemplate>
                        </igtbl:TemplatedColumn>                 
                    </Columns>               
                </igtbl:UltraGridBand>
            </Bands>
            ...
    </igtbl:UltraWebGrid>
           
        protected void DropDownList1_OnInit(object sender, EventArgs e)
        {
            DropDownList dropDownList = sender as DropDownList;
            CellItem parentCell = (CellItem) dropDownList.NamingContainer;

            if (parentCell.Cell.Row.BandIndex != 3)
            {
                dropDownList.Visible = false;
            }       
        }

    Hope this helps.

    PS. This forums is related to our online Exemplars / Showcases projects, you can ask similar question directly in the WebGrid product forum -

    http://forums.infragistics.com/forums/61.aspx 

    chances are, more people with that knowledge will see it there.