Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
108 views
Hi
 I always want a row to be selected when the grid loads.how to do this?
Princy
Top achievements
Rank 2
 answered on 03 Dec 2013
2 answers
412 views
Hi Guys,

First time poster and relatively new to Telerik controls, especially the RadGrid! I've been searching for a solution to my problem but as yet have not been able to find one so hopefully someone can help me.

I have a RadGrid which displays form entry submissions and then the data entered for each submission within a detail table. It's all working fine, but being a UI guy I want to alter the Colspan of the table cell in which the detail table sits to one less so there is an equal indentation at either side. I was able to find out how to do this and have used the code below to do so:

protected void gdSubmissions_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridNestedViewItem)
        {
            GridNestedViewItem item = e.Item as GridNestedViewItem;
            int newColSpanValue = item.NestedViewCell.ColumnSpan -1;
            item.NestedViewCell.Attributes["colspan"] = newColSpanValue.ToString();
            item.NestedViewCell.Style.Add("padding", "5px");
            item.NestedViewCell.Style.Add("border-bottom", "1px solid #e8e8e8");
        }
    }

However, now I have a problem where for certain criteria I need to hide certain columns of the grid and when doing so, the colspan is now incorrect and is not taking in to account just the VISIBLE columns. See the attached images to see what I mean.

Here is the code I use to hide the columns:

protected void gdSubmissions_PreRender(object sender, EventArgs e)
    {
        RemoveExpandIconWhenNoRecords(gdSubmissions.MasterTableView);
 
        // Hide Columns
        if (usesApproval)
        {
            gdSubmissions.MasterTableView.GetColumn("Resubmit").Visible = (_submissionStatus == -1);
            gdSubmissions.MasterTableView.GetColumn("Approve").Visible = (_submissionStatus == 0);
            gdSubmissions.MasterTableView.GetColumn("Reject").Visible = (_submissionStatus == 0);
        }
     }

I appreciate that this may or may not be the best way to do this.

Any help is much appreciated.

Rob.
Venelin
Telerik team
 answered on 03 Dec 2013
1 answer
102 views
Hi
i have a radbutton in the itemtemplate of a column. How to get the rowindex of the selected button row on clientside? 
Shinu
Top achievements
Rank 2
 answered on 03 Dec 2013
2 answers
134 views
Is it possible to have a logarithmic scale on the line chart axes (either x, y, or both)?  I don't see anything in the help or forum.

I'd like to replace my old graphs on the web site (see attached).
Tom
Top achievements
Rank 1
 answered on 03 Dec 2013
1 answer
101 views
Hi.
how to reorder/swap the columns in a radgrid.?
Princy
Top achievements
Rank 2
 answered on 03 Dec 2013
4 answers
174 views
Hi, I created custom skin from black skin and modified it. When I set radmenu width to 100% (to stretch entire page) I am getting black background instead of mine color (#5d646d). Please help.

Menu.Black.css
/* <RadMenu / Black> */

.RadMenu_Black .rmRootGroup,
.RadMenu_Black a.rmLink,
.RadMenu_Black .rmText,
.RadMenu_Black .rmLeftArrow,
.RadMenu_Black .rmRightArrow,
.RadMenu_Black .rmTopArrow,
.RadMenu_Black .rmBottomArrow
{
    background-image: url('Menu/rmSprite.png');
    background-color: transparent;
}
.RadMenu_Black .rmRootGroup
{

    background-repeat: repeat-x;
    background-color: #161616;
}

.RadMenu_Black .rmVertical
{
    background-position: 0 -408px;
}

/* <Root items> */

.RadMenu_Black,
.RadMenu_Black a.rmLink
{
    font-family:Calibri;
    font-size:16px;
    font-weight:bold;
    color:LightBlue;
    background-color:#5d646d;
    text-decoration: none;
}

.RadMenu_Black a.rmLink:hover
{
    color: Yellow;
}

.RadMenu_Black a.rmLink,
.RadMenu_Black .rmText
{
    background-repeat: no-repeat;
    background-position: 0 500px;
}

.RadMenu_Black a.rmLink:hover,
.RadMenu_Black a.rmFocused,
.RadMenu_Black a.rmSelected
{
    background-position: 0 -72px;
}

.RadMenu_Black a.rmExpanded,
.RadMenu_Black a.rmExpanded:hover
{
    background-position: 0 -72px;
}

.RadMenu_Black a.rmExpanded .rmText,
.RadMenu_Black a.rmExpanded:hover .rmText
{
    background-position: 100% -96px;
}

.RadMenu_Black .rmLast a.rmExpanded .rmText
{
    background-position: 0 500px;
    background-repeat: no-repeat;
}

.RadMenu_Black a.rmDisabled,
.RadMenu_Black a.rmDisabled:hover
{
    color: #7d7d7d;
    background-position: 0 500px;
}

/* </Root items> */


/* <Submenu items> */

.RadMenu_Black .rmGroup,
.RadMenu_Black .rmMultiColumn,
.RadMenu_Black .rmGroup .rmVertical
{
    border: 1px solid #080808;
    background: #4f4f4f url('Menu/rmVSprite.png') repeat-y 0 0;
}

.RadMenu_Black .rmTopFix,
.RadMenu_Black .rmBottomFix,
.RadMenu_Black .rmRoundedCorners .rmGroup .rmItem,
.RadMenu_Black .rmRoundedCorners li.rmFirstGroupColumn .rmItem,
.RadMenu_Black .rmRoundedCorners .rmFirstGroupColumn li.rmFirstGroupColumn .rmItem,
.RadMenu_Black .rmRoundedCorners ul.rmHorizontal .rmFirst,
.RadMenu_Black_Context.rmRoundedCorners .rmGroup .rmItem,
.RadMenu_Black_Context.rmRoundedCorners ul.rmHorizontal .rmFirst
{
    background-image: url('Menu/rmVSprite.png');
    background-color: #4f4f4f;
    background-repeat: repeat-y;
}

* html .rmRoundedCorners_Black .rmGroup .rmItem,
* html .rmRoundedCorners_Black ul.rmHorizontal .rmFirst
{
    background-image: url('Menu/rmVSprite.png');
    background-color: #4f4f4f;
    background-repeat: repeat-y;
}

.RadMenu_Black .rmRoundedCorners .rmScrollWrapContainer .rmGroup,
.RadMenu_Black .rmRoundedCorners .rmScrollWrap .rmItem,
.RadMenu_Black .rmRoundedCorners .rmGroupColumn .rmItem,
.RadMenu_Black .rmRoundedCorners .rmGroupColumn .rmGroupColumn .rmItem,
.RadMenu_Black .rmRoundedCorners .rmHorizontal .rmItem,
.RadMenu_Black .rmRoundedCorners .rmScrollWrap .rmVertical,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrapContainer .rmGroup,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrap .rmItem,
.RadMenu_Black_Context.rmRoundedCorners .rmHorizontal .rmItem,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrap .rmVertical
{
    background-image: none;
}

* html .rmRoundedCorners_Black .rmScrollWrapContainer .rmGroup,
* html .rmRoundedCorners_Black .rmScrollWrap .rmItem,
* html .rmRoundedCorners_Black .rmHorizontal .rmItem,
* html .rmRoundedCorners_Black .rmScrollWrap .rmVertical
{
    background-image: none;
}

.RadMenu_Black .rmRoundedCorners .rmGroupColumn
{
    background-color: #4f4f4f;
}

.RadMenu_Black .rmBottomLeft,
.RadMenu_Black .rmRoundedCorners .rmScrollWrapContainer,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrapContainer,
.RadMenu_Black_Context.rmRoundedCorners ul.rmGroup,
.RadMenu_Black .rmRoundedCorners ul.rmGroup,
.RadMenu_Black .rmRoundedCorners .rmMultiColumn
{
    background-image:  url('Menu/rmRoundedLeft.png');
    background-color: transparent;
    background-repeat: no-repeat;
}

* html .rmRoundedCorners_Black .rmScrollWrapContainer,
* html .rmRoundedCorners_Black .rmGroup ul.rmGroup,
* html .rmRoundedCorners_Black ul.rmGroup
{
    background-image:  url('Menu/rmRoundedLeft.png');
    background-color: transparent;
    background-repeat: no-repeat;
}

.RadMenu_Black .rmTopRight,
.RadMenu_Black .rmBottomRight
{
    background-image:  url('Menu/rmRoundedRight.png');
    background-color: transparent;
    background-repeat: no-repeat;
}

.RadMenu_Black .rmTopFix,
.RadMenu_Black .rmBottomFix,
.RadMenu_Black .rmRoundedCorners .rmGroup .rmFirst,
.RadMenu_Black_Context.rmRoundedCorners .rmGroup .rmFirst,
.rmRoundedCorners_Black .rmGroup .rmFirst
{
    border-color: #080808;
}

.RadMenu_Black .rmRoundedCorners .rmScrollWrapContainer .rmTopFix,
.RadMenu_Black .rmRoundedCorners .rmScrollWrapContainer .rmBottomFix,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrapContainer .rmTopFix,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrapContainer .rmBottomFix
{
    background: #4F4F4F;
}

* html .rmRoundedCorners_Black .rmScrollWrapContainer .rmTopFix,
* html .rmRoundedCorners_Black .rmScrollWrapContainer .rmBottomFix
{
    background: #4F4F4F;
}

.RadMenu_Black .rmRoundedCorners .rmScrollWrapContainer .rmTopArrow,
.RadMenu_Black .rmRoundedCorners .rmScrollWrapContainer .rmBottomArrow,
.RadMenu_Black .rmRoundedCorners .rmScrollWrapContainer .rmLeftArrow,
.RadMenu_Black .rmRoundedCorners .rmScrollWrapContainer .rmRightArrow,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrapContainer .rmTopArrow,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrapContainer .rmBottomArrow,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrapContainer .rmLeftArrow,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrapContainer .rmRightArrow
{
    background-color: #4F4F4F;
    border: 0;
}

* html .rmRoundedCorners_Black .rmScrollWrapContainer .rmTopArrow,
* html .rmRoundedCorners_Black .rmScrollWrapContainer .rmBottomArrow,
* html .rmRoundedCorners_Black .rmScrollWrapContainer .rmLeftArrow,
* html .rmRoundedCorners_Black .rmScrollWrapContainer .rmRightArrow
{
    background-color: #4F4F4F;
    border: 0;
}

.RadMenu_Black_rtl .rmBottomLeft,
.RadMenu_Black_rtl .rmRoundedCorners ul.rmGroup,
.RadMenu_Black_rtl .rmRoundedCorners .rmMultiColumn,
.RadMenu_Black .rmRoundedCorners .rmScrollWrapContainer,
.RadMenu_Black .rmScrollWrapContainer .rmBottomLeft,
.rmRoundedCorners.RadMenu_Black_Context_rtl ul.rmGroup,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrapContainer
{
    background-image: url('Menu/rmRoundedLeft_rtl.png');
}

.RadMenu_Black_rtl .rmTopRight,
.RadMenu_Black_rtl .rmBottomRight
{
    background-image: url('Menu/rmRoundedRight_rtl.png');
}

.RadMenu_Black_rtl li.rmTopFix,
.RadMenu_Black_rtl li.rmBottomFix,
.RadMenu_Black_rtl .rmRoundedCorners .rmGroup .rmItem,
.rmRoundedCorners.RadMenu_Black_Context_rtl .rmGroup .rmItem
{
    background-position: 101% 0;
}

.RadMenu_Black .rmSlide .rmScrollWrap
{
    background-image: none;
}

.RadMenu_Black_rtl .rmGroup,
.RadMenu_Black_rtl .rmMultiColumn,
.RadMenu_Black_rtl .rmGroup .rmVertical
{
    background-position: 100% 0;
}

.RadMenu_Black .rmRootGroup li.rmItem .rmGroup
{
    padding-bottom: 0;
}

.RadMenu_Black .rmGroup li.rmLast
{
    padding-bottom: 1px;
}

.RadMenu_Black .rmRootGroup .rmHorizontal
{
    background-image: none;
}

.RadMenu_Black .rmScrollWrap .rmVertical
{
    border: 0;
}

.RadMenu_Black .rmRoundedCorners .rmScrollWrapContainer li.rmItem,
.RadMenu_Black_Context.rmRoundedCorners .rmScrollWrapContainer li.rmItem,
.rmRoundedCorners_Black .rmScrollWrapContainer li.rmItem
{
    background: none;
}

.RadMenu_Black .rmGroup .rmItem a.rmLink,
.RadMenu_Black .rmGroup .rmItem a.rmLink:hover,
.RadMenu_Black .rmGroup .rmItem a.rmFocused,
.RadMenu_Black .rmGroup .rmItem a.rmSelected,
.RadMenu_Black .rmGroup .rmItem a.rmExpanded
{
    padding-bottom: 0;
    border: 0;

}

.RadMenu_Black .rmGroup a.rmLink,
.RadMenu_Black .rmGroup .rmText,
.RadMenu_Black .rmGroup .rmItem a.rmDisabled,
.RadMenu_Black .rmGroup .rmItem a.rmDisabled:hover,
.RadMenu_Black .rmGroup .rmItem a.rmDisabled .rmText,
.RadMenu_Black .rmGroup .rmItem a.rmDisabled:hover .rmText
{
    background-position: 0 500px;
    background-repeat: no-repeat;
    background-color: transparent;
    font-size:medium;
    font-weight:normal;
    color:White;
}

.RadMenu_Black .rmGroup a.rmLink:hover,
.RadMenu_Black .rmGroup a.rmFocused,
.RadMenu_Black .rmGroup a.rmSelected,
.RadMenu_Black .rmGroup a.rmExpanded
{
    background-position: 0 -168px;
}

.RadMenu_Black .rmGroup a.rmLink:hover .rmText,
.RadMenu_Black .rmGroup a.rmFocused .rmText,
.RadMenu_Black .rmGroup a.rmSelected .rmText,
.RadMenu_Black .rmGroup a.rmExpanded .rmText
{
    background-position: 100% -192px;
    color:Yellow;
}

/* <expand arrows> */

.RadMenu_Black .rmVertical .rmExpandRight,
.RadMenu_Black .rmGroup .rmExpandDown,
.RadMenu_Black_Context .rmGroup .rmExpandRight,
.RadMenu_Black .rmVertical .rmItem a.rmDisabled .rmExpandRight,
.RadMenu_Black .rmGroup .rmItem a.rmDisabled .rmExpandDown,
.RadMenu_Black .rmVertical .rmItem a.rmDisabled:hover .rmExpandRight,
.RadMenu_Black .rmGroup .rmItem a.rmDisabled:hover .rmExpandDown
{
    background-position: 100% -216px;
}
.RadMenu_Black .rmHorizontal .rmExpandDown
{
    background: transparent url('Menu/rmSprite.png') no-repeat rightright !important;
    display: inline-block !important;
}
.RadMenu_Black .rmVertical a.rmLink:hover .rmExpandRight,
.RadMenu_Black .rmVertical a.rmFocused .rmExpandRight,
.RadMenu_Black .rmVertical a.rmSelected .rmExpandRight,
.RadMenu_Black .rmVertical a.rmExpanded .rmExpandRight
{
    background-position: 100% -312px;
}

.RadMenu_Black .rmGroup a.rmLink:hover .rmExpandRight,
.RadMenu_Black .rmGroup a.rmFocused .rmExpandRight,
.RadMenu_Black .rmGroup a.rmSelected .rmExpandRight,
.RadMenu_Black .rmGroup a.rmExpanded .rmExpandRight,
.RadMenu_Black .rmGroup a.rmLink:hover .rmExpandDown,
.RadMenu_Black .rmGroup a.rmFocused .rmExpandDown,
.RadMenu_Black .rmGroup a.rmSelected .rmExpandDown,
.RadMenu_Black .rmGroup a.rmExpanded .rmExpandDown
{
    background-position: 100% -240px;
}

.RadMenu_Black .rmVertical a.rmDisabled:hover .rmExpandRight,
.RadMenu_Black .rmGroup a.rmDisabled:hover .rmExpandDown
{
    background-image: url('Menu/rmSprite.png');
    background-position: 100% -216px;
}

/* </expand arrows> */

/* <rtl> */

.RadMenu_Black_rtl .rmVertical a.rmExpanded .rmText,
.RadMenu_Black_rtl .rmVertical a.rmExpanded:hover .rmText
{
    background-position: 0 500px;
    background-repeat: no-repeat;
}

.RadMenu_Black_rtl .rmGroup a.rmLink:hover,
.RadMenu_Black_rtl .rmGroup a.rmFocused,
.RadMenu_Black_rtl .rmGroup a.rmSelected,
.RadMenu_Black_rtl .rmGroup a.rmExpanded
{
    background-position: 100% -264px;
}

.RadMenu_Black_rtl .rmGroup a.rmLink:hover .rmText,
.RadMenu_Black_rtl .rmGroup a.rmFocused .rmText,
.RadMenu_Black_rtl .rmGroup a.rmSelected .rmText,
.RadMenu_Black_rtl .rmGroup a.rmExpanded .rmText
{
    background-position: 0 -288px;
}

.RadMenu_Black_Context_rtl .rmVertical .rmExpandLeft,
.RadMenu_Black_rtl .rmRootGroup .rmExpandLeft
{
    background-position: 0 -312px;
}

.RadMenu_Black_rtl .rmVertical a.rmLink:hover .rmExpandLeft,
.RadMenu_Black_rtl .rmVertical a.rmFocused .rmExpandLeft,
.RadMenu_Black_rtl .rmVertical a.rmSelected .rmExpandLeft,
.RadMenu_Black_rtl .rmVertical a.rmExpanded .rmExpandLeft
{
    background-position: 0 -216px;
}

.RadMenu_Black_rtl .rmGroup a.rmLink:hover .rmExpandLeft,
.RadMenu_Black_rtl .rmGroup a.rmFocused .rmExpandLeft,
.RadMenu_Black_rtl .rmGroup a.rmSelected .rmExpandLeft,
.RadMenu_Black_rtl .rmGroup a.rmExpanded .rmExpandLeft
{
    background-position: 0 -336px;
}

.RadMenu_Black_rtl .rmRootGroup a.rmDisabled:hover .rmExpandLeft
{
    background-position: 0 -312px;
}


/* </rtl> */

/* </Submenu items> */

/* <Submenu offsets (Black - specific, overlapping submenus)> */

.RadMenu_Black .rmSlide
{
    margin: 0 0 0 -1px;
}

.RadMenu_Black .rmVertical .rmSlide,
.RadMenu_Black .rmSlide .rmSlide,
.RadMenu_Black_Context .rmGroup .rmSlide
{
    margin: 0 0 0 -5px;
}

.RadMenu_Black_rtl .rmSlide
{
    margin: 0 0 0 0;
}

.RadMenu_Black_rtl .rmFirst .rmSlide
{
    margin-left: 1px;
}

.RadMenu_Black_rtl .rmVertical .rmSlide,
.RadMenu_Black_rtl .rmSlide .rmSlide,
.RadMenu_Black_Context_rtl .rmGroup .rmSlide
{
    margin: 0 0 0 5px;
}

/* </Submenu offsets> */

/* <Scrolling arrows> */

.RadMenu_Black .rmLeftArrow,
.RadMenu_Black .rmRightArrow
{
    background-color: #4f4f4f;
}

.RadMenu_Black .rmLeftArrow { background-position: -8px -312px; border-right: 1px solid #828282; }
.RadMenu_Black .rmRightArrow { background-position: -482px -216px; border-left: 1px solid #828282; }

.RadMenu_Black .rmTopArrow,
.RadMenu_Black .rmBottomArrow,
.RadMenu_Black .rmGroup .rmLeftArrow,
.RadMenu_Black .rmGroup .rmRightArrow
{
    background-color: #4f4f4f;
}

.RadMenu_Black .rmTopArrow { background-position: 50% -367px; border-bottom: 1px solid #828282; }
.RadMenu_Black .rmBottomArrow { background-position: 50% -391px; border-top: 1px solid #828282; }

/* </Scrolling arrows> */

/* <Separators> */

.RadMenu_Black .rmHorizontal .rmSeparator .rmText,
.RadMenu_Black .rmVertical .rmHorizontal .rmSeparator .rmText
{
    height: 22px;
    margin: 1px 0 0;
    width: 1px;
    background-color: #000;
}

.RadMenu_Black_Context .rmSeparator .rmText,
.RadMenu_Black .rmHorizontal .rmGroup .rmSeparator .rmText,
.RadMenu_Black .rmVertical .rmHorizontal .rmGroup .rmSeparator .rmText
{
    background-color: transparent;
    background-position: 0 -406px;
}

/* </Separators> */

/* </RadMenu / Black> */

Regards, Lev
Lev
Top achievements
Rank 1
Iron
Iron
 answered on 03 Dec 2013
1 answer
201 views
Hi.
i have a grid in that i have a gridbuttoncolumn for delete. I want to hide it for some rows only.how to do it?
Shinu
Top achievements
Rank 2
 answered on 03 Dec 2013
1 answer
87 views
Hi All,

I am using Radeditor and for some reason the dropdowns in RadEditor are covering some items on IPAD. I would really appreciate if somebody could help to resolve this issue.

Thank you in advance for your prompt attention and response.



Ianko
Telerik team
 answered on 03 Dec 2013
1 answer
234 views
Hi,

How can I pass parameters to Lightbox from Radgrid Item_DataBound? I am trying to bind RadHtmlChart based on RadGrid DataKey value. Here is my code. Could you please let me know? I am not sure how to do this. I just upgraded our projects to new controls. Thanks for any help.


  <telerik:RadLightBox ID="RadLightBox1" runat="server" width="400px" height="350px">
    <Items>
        <telerik:RadLightBoxItem>
            <ItemTemplate>
                    <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Transitions="true" Skin="Metro"
                                    OnClientSeriesClicked="OnClientChartClicked">
                                    <PlotArea>
                                        <Series>
                                            <telerik:PieSeries DataFieldY="total" NameField="office" ColorField="PartyColor"
                                                ExplodeField="IsExploded">
                                                <LabelsAppearance DataFormatString="{0}" >
                                                </LabelsAppearance>
                                            </telerik:PieSeries>
                                        </Series>
                                    </PlotArea>
                                </telerik:RadHtmlChart>
            </ItemTemplate>
            </telerik:RadLightBoxItem>
            </Items>
    </telerik:RadLightBox>



 <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" GridLines="None"
                                Skin="Office2007" Width="600px" Style="height: auto;" OnItemDataBound="RadGrid1_ItemDataBound">
                                <MasterTableView ShowHeadersWhenNoRecords="true" DataKeyNames="type_id">
                                    <Columns>
                                        <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" DataField="Name"
                                            HeaderText="Name" ReadOnly="True" UniqueName="Name">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="count" HeaderText="Total" UniqueName="count">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridHyperLinkColumn Text="View Details" UniqueName="viewDeatils" />
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
Code behind
-----------------------------------------------
       protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                HyperLink link = (HyperLink)item["viewDeatils"].Controls[0];
                int index = item.ItemIndex;
               link.Attributes.Add("onclick", String.Format("ShowGraph('{0}');", item.GetDataKeyValue("type_id").ToString()));
            }

Javascript:
----------------------

     function ShowGraph() {
                var lightBox1 = $find('<%= RadLightBox1.ClientID %>');
                lightBox1.show();
            }


        }

Kostadin
Telerik team
 answered on 03 Dec 2013
6 answers
403 views
I am trying to paging for detail table in RadGrid. but when i click on page's it is getting back to grid bind.

My code is :-

  <telerik:RadGrid ID="rdSettings" runat="server" AllowPaging="true" width="100%" AutoGenerateColumns="false"
                        OnDetailTableDataBind="rdSettings_DetailTableDataBind" Skin="Metro" OnPageIndexChanged="rdSettings_PageIndexChanged" OnPageSizeChanged="rdSettings_PageSizeChanged" Visible="false">
                    <MasterTableView  DataKeyNames="Module">
                    <DetailTables>
                    <telerik:GridTableView Name="group" Width="100%" AutoGenerateColumns="false">
                      <Columns>
                        <telerik:GridTemplateColumn ItemStyle-Width="5%">
                           <ItemTemplate>
                                <asp:CheckBox ID="chkGroup" runat="server" AutoPostBack="true" OnCheckedChanged="chkGroup_CheckedChanged"/>
                          </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="groupname" UniqueName="groupname" HeaderText="Group" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            </telerik:GridBoundColumn>
                      </Columns>
                    </telerik:GridTableView>
                    </DetailTables>
                         <Columns>
                            <telerik:GridTemplateColumn HeaderText="Select">
                                <HeaderTemplate>
                                    <asp:CheckBox ID="chkHeader" AutoPostBack="true" runat="server" OnCheckedChanged="chkHeader_CheckedChanged" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkmodule" runat="server" OnCheckedChanged="chkmodule_CheckedChanged" AutoPostBack="true" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="Module" UniqueName="Module" HeaderText="Module" ItemStyle-Width="85%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            </telerik:GridBoundColumn>
                         </Columns>
                    </MasterTableView>
                </telerik:RadGrid>



And Detail Table code is



protected void rdSettings_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) // Bind's the nested Grid for Page Settings
    {
        string groupname = "";
        GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
        switch (e.DetailTableView.Name)
        {
            case "group":
                {
                    groupname = dataItem.GetDataKeyValue("Module").ToString();
                    string sqlquery = "select distinct(groupname) from [dbo].[POColumns] where module= '" + groupname + "'";
                    SqlDataAdapter da = new SqlDataAdapter(sqlquery, ScrCon);
                    DataSet ds = new DataSet();
                    da.Fill(ds);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        e.DetailTableView.DataSource = ds;
                    }
                    break;
                }
        }
    }


Please help out what else i have to do get the paging in Detail Table
Raghunath
Top achievements
Rank 2
 answered on 03 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?