Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
172 views

Hi,
when we are using client side binding of DetailTables in RaDgrid following issues we found

1.Unable toassign multiple datakeynames for ClientDataKeyNames, when we tried its throwing error
2. Unable to Hide and show the Expand and Collpase buttons on RadGrid1_ItemDataBound
3. Unable to find the control in the detailtables

Thanks,
Sridevi.

Shinu
Top achievements
Rank 2
 answered on 26 Nov 2008
1 answer
74 views
I was trying various ways to change style at print time. Setting media to print didn't get me what i wanted. When debugging in Firefox i noticed that the grid control has a toggleCssClass method but i can't find any doc on it. Does this mean i can change CssClass in Javascript so it can be set before i print the page and then reset ti after print?
Vlad
Telerik team
 answered on 26 Nov 2008
1 answer
191 views
Hi..
Can an onchange event be added to a RadGrid - inorder to monitor changes?
Is there another event that is more appropriate? To monitor Insert/Updates/ Deletes?
thanks
Princy
Top achievements
Rank 2
 answered on 26 Nov 2008
3 answers
2.2K+ views
With a standard Gridview I can do like this:

  
        foreach (GridViewRow row in GridView1.Rows)
            {

            Label lblAmount = (Label)row.FindControl("lblAmount") as Label;


How do I resolve it with a RadGrid? I'm lost and new with this..
Princy
Top achievements
Rank 2
 answered on 26 Nov 2008
2 answers
144 views
Like the sum, count, max,  etc. of every column, how can I access this values coz I need them for something else.
Thanks
Albert
Top achievements
Rank 1
 answered on 26 Nov 2008
1 answer
172 views
Hi,
I have a RadGrid and a button on a page. I bind the grid to a datatable on the button click event.
The problem I face is once I sort certain column in certain order by clicking on the column header, It maintains this state even after I bind the grid to a new datasource. So how do i remove the old sort order on the grid and reset the grid to it's actual state while I rebind the grid to a new datasource.

thnx
madhu
Shinu
Top achievements
Rank 2
 answered on 26 Nov 2008
1 answer
80 views
in edit mode when updating it's writing null values for columns that are readonly.
Thanks
Shinu
Top achievements
Rank 2
 answered on 26 Nov 2008
1 answer
102 views
Hey there,

I have several GridBoundColumns that are set to hidden.  They only display in the edit form view, but I would like them to show up when I export to Excel, PDF and Word.  I've tried the following, but I'm not even sure if it's the right approach:

foreach (GridColumn gc in mlRadGrid.MasterTableView.Columns) 
{ 
     gc.Visible = true; 
} 

Any help would be much appreciated!

-Derek
Shinu
Top achievements
Rank 2
 answered on 26 Nov 2008
1 answer
117 views
Hi

I am using the example code Collapse group and it throws an ArgumentOutOfRageExceptiopn (Specified argument was out of the range of valid values).  I believe it is the Controls(0).  My Grouping is static, defined in Asp code.  It works with out this code.  I have Telerik Asp.Net AJAX 2008 3 1105 dll's.

Partial Class Dispatcher_MismatchedReport
    Inherits System.Web.UI.Page
    '
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Not (IsPostBack)) Then
            CollapseAll()
        End If
    End Sub ' Page_Load
    '
    Private Sub CollapseAll()
        Dim item As GridItem
        For Each item In RadGrid1.MasterTableView.Controls(0).Controls
            If TypeOf item Is GridGroupHeaderItem Then
                item.Expanded = False
            End If
        Next item
    End Sub ' CollapseAll
    '
End Class

 

 

Phil
Top achievements
Rank 2
 answered on 26 Nov 2008
1 answer
143 views

Here is my environment Specs:

  1. ASP.NET 2.0
  2. Microsoft Windows XP Professional Version 2002 SP2
  3. IE V 7
  4. Telerik Q2 2008 
  5. C#

I have a radgrid that has more than one page of data to show, the data on the page is being filled correctly, and I am limiting it to 20 records per page. I am using both the numbers href links to page through the grid and the arrow, as more data is available to be shown. When I click on the page number or arrow to page through the data in the rad grid I get the following error (also in green where it happens on my code behind snippet down below):

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

My debug triggers the error on the codebehind on this line, in the rgUsers_ItemCommand() when I try to page to the next 20 records:
string sUserName = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["UserName"].ToString();

Do I need to do a conditional check to make sure that the rgUsers table has a row count greater than zero? Or is there some property I am not using to allow this? My dataset returns 30 users so I expect to see at least 10 users on page 2 of the radgrid.

Code from the aspx Page:

 

 

 

<telerik:RadGrid ID="rgUsers" Skin="Office2007" runat="server" AllowPaging="True" 
                        PageSize="20" AllowSorting="True" Width="100%" AutoGenerateColumns="False" OnNeedDataSource="rgUsers_OnNeedDataSource" 
                        OnPreRender="rgUsers_PreRender" OnDeleteCommand="rgUsers_DeleteCommand" OnItemCommand="rgUsers_ItemCommand" GridLines="None">  
                        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> 
                        <MasterTableView CommandItemDisplay="None" GridLines="None" DataKeyNames="UserName">  
                            <RowIndicatorColumn Visible="False">  
                                <HeaderStyle Width="20px" /> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn Visible="False">  
                                <HeaderStyle Width="19px" /> 
                            </ExpandCollapseColumn> 
                            <Columns> 
                                <telerik:GridEditCommandColumn> 
                                </telerik:GridEditCommandColumn> 
                                <telerik:GridBoundColumn DataField="UserName" HeaderText="UserName" UniqueName="UserName">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="Email" HeaderText="Email" UniqueName="Email">  
                                    <HeaderStyle Width="25%" /> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="LastActivityDate" HeaderText="Last Activity Date" 
                                    UniqueName="LastActivityDate">  
                                    <HeaderStyle Width="15%" /> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridCheckBoxColumn DataField="IsApproved" HeaderText="Approved" UniqueName="IsApproved">  
                                    <HeaderStyle Width="12%" /> 
                                </telerik:GridCheckBoxColumn> 
                                <telerik:GridCheckBoxColumn DataField="IsLockedOut" HeaderText="Locked Out" UniqueName="IsLockedOut">  
                                    <HeaderStyle Width="12%" /> 
                                </telerik:GridCheckBoxColumn> 
                                <telerik:GridTemplateColumn UniqueName="TemplateColumn1">  
                                    <ItemTemplate> 
                                        &nbsp;<asp:LinkButton ID="lnkBtnDelete" runat="server" CausesValidation="false" CommandName="Delete" 
                                            ForeColor="#044A7E" Text="Delete" Visible='<%# DelButShowHide((DataBinder.Eval (Container.DataItem, "UserName").ToString())) %>'></asp:LinkButton> 
                                    </ItemTemplate> 
                                    <HeaderStyle Width="8%" /> 
                                </telerik:GridTemplateColumn> 
                            </Columns> 
                            <EditFormSettings> 
                                <EditColumn UniqueName="EditCommandColumn1">  
                                </EditColumn> 
                            </EditFormSettings> 
                        </MasterTableView> 
                        <HeaderStyle HorizontalAlign="Left" /> 
                        <FilterMenu EnableTheming="True" Skin="Office2007">  
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </FilterMenu> 
                        <SortingSettings SortedAscToolTip="/Manager/images/arrw_up.gif" SortedDescToolTip="/Manager/images/arrw_d.gif" /> 
                    </telerik:RadGrid> 

 

 

Code from the aspx.cs code behind:

 

 

 

protected void rgUsers_ItemCommand(object source, GridCommandEventArgs e)  
    {  
 
        //Errors out on this line :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index  
         string sUserName = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["UserName"].ToString();  
        //End Error out on this line  
 
        MembershipUser oUser = Membership.GetUser(sUserName);  
        DisplayMessage(string.Empty);  
 
        if (e.CommandName == RadGrid.EditCommandName)//Edit a user  
        {  
            e.Canceled = true;//interrupts the rgUsers commands so that it does not show inline edit forms  
              
            hdnSubmitType.Value = "UpdateUser";  
            PageMode = mode.form;  
            RolePrivPanelMode = RolePrivMode.roleChoice; //sets default to role selected  
            tbUserName.Enabled = false;  
            hydrateEditForm(oUser);  
            buildRadTrees(UserInfo.UserIdentityKey.ToString(), oUser.ProviderUserKey.ToString());  
              
            UserInfo.UserIdentityKey.ToString());  
            CheckedRadTreesNodes(oUser);  
            RolePrivPanelMode = RolePrivMode.roleChoice; //set Roles panel to be shown  
 
        }  
    } 

 

 

 

 

 

Eric
Top achievements
Rank 1
 answered on 25 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?