How to Find Certain Column ,Certain Cell values In the Rad Grid

3 posts, 0 answers
  1. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 07 May 2013 Link to this post

    I am new in using telerik rad Grid,I have requirement like this

    Column1 | Column2

    java | check Box

    .Net | check Box

    Python | check Box

    Like this ,The above one is existing "Rad Grid" having two columns , I want to know In Column2 which check box is checked.,using the allowMultipleRowSelection="true"..,how to find that a particular Check box is checked or Not. Eg:- .Net Row checked Box is checked just assume

    how to find that particular check-box of that .net Row,In

    Insert And Update ,But it's inside of  other grid not an Independent grid. Parent Grid Insert Or Update I need to Find out that particular one.

    please give reply...if any one Knows.



    This Is Code....

               <telerik:RadGrid ID="RgList1" runat="server" AutoGenerateColumns="false" 
                            ShowHeader="false" Width="148px"  >
                            <MasterTableView AutoGenerateColumns="false" >
                            <Columns>
                                <telerik:GridTemplateColumn >
                                <ItemTemplate>
                                <%# Eval("BankTypeName")%>
                                </ItemTemplate>
                                 </telerik:GridTemplateColumn>
                                 <telerik:GridTemplateColumn UniqueName="chkBankList1">
                                 <ItemTemplate>
                                 <asp:CheckBox ID="chkBankTypeName" runat="server"  />
                                 </ItemTemplate>
    
                                </Columns>
                            </MasterTableView>
                  <ClientSettings  AllowColumnsReorder="true" EnableRowHoverStyle="true"   > 
                 <Selecting AllowRowSelect="true"/>
                 </ClientSettings>  
    </telerik:RadGrid>

    I want to find  the  whether check Box is checked or Not  in .aspx.cs file

    See The Image You very  clear  idea About asked  the Question

  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 08 May 2013 Link to this post

    Hello,

    protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
        {
            GridEditableItem item = e.Item as GridEditableItem;
            RadGrid RgList1 = item.FindControl("RgList1") as RadGrid;
            if (RgList1 != null)
            {
                foreach (GridDataItem citem in RgList1.MasterTableView.Items)
                {
                    CheckBox chkBankTypeName = citem.FindControl("chkBankTypeName") as CheckBox;
                    if(chkBankTypeName != null && chkBankTypeName.Checked)
                    {
    string s1 = item.GetDataKeyValue("BankTypeName").ToString();
                        // perform your logic here
                    }
                }
            }
        }
    <telerik:RadGrid ID="RgList1" runat="server" AutoGenerateColumns="false"
                            ShowHeader="false" Width="148px"  >
                            <MasterTableView AutoGenerateColumns="false"  DataKeyNames="BankTypeName">
                            <Columns>
                                <telerik:GridTemplateColumn >
                                <ItemTemplate>
                                <%# Eval("BankTypeName")%>
                                </ItemTemplate>
                                 </telerik:GridTemplateColumn>
                                 <telerik:GridTemplateColumn UniqueName="chkBankList1">
                                 <ItemTemplate>
                                 <asp:CheckBox ID="chkBankTypeName" runat="server"  />
                                 </ItemTemplate>
     
                                </Columns>
                            </MasterTableView>
                  <ClientSettings  AllowColumnsReorder="true" EnableRowHoverStyle="true"   >
                 <Selecting AllowRowSelect="true"/>
                 </ClientSettings
    </telerik:RadGrid>

    //OR

    protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
        {
            GridEditableItem item = e.Item as GridEditableItem;
            RadGrid RgList1 = item.FindControl("RgList1") as RadGrid;
            if (RgList1 != null)
            {
                foreach (GridDataItem citem in RgList1.SelectedItems)
                {
    string s1 = item.GetDataKeyValue("BankTypeName").ToString();
                    // perform your logic here
                }
            }
        }
    <telerik:RadGrid ID="RgList1" runat="server" AutoGenerateColumns="false" ShowHeader="false"
                Width="148px" AllowMultiRowSelection="true">
                <MasterTableView AutoGenerateColumns="false" DataKeyNames="BankTypeName">
                    <Columns>
                        <telerik:GridTemplateColumn>
                            <ItemTemplate>
                                <%# Eval("BankTypeName")%>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridClientSelectColumn UniqueName="chkBankList1">
                        </telerik:GridClientSelectColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowColumnsReorder="true" EnableRowHoverStyle="true">
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
            </telerik:RadGrid>


    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 08 May 2013 Link to this post

    Thanks& I Am solved The Issue ... ....It's very useful  to me.......thanks...for support   SaiRam pamidi
Back to Top