Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
98 views
Hello, I have paging enabled for the radgrid control. I bind the radgrid to a datatable. In the RadGrid1_ItemDataBound , I would like to go over every row bound to the grid and based on the value of a cell, I want to change the background color of the corresponding row. This works fine when paging is not enabled(that is all rows bound to the radgrid is on one page). But when I have multiple pages, I see that RadGrid1_ItemDataBound event gets fired only for rows in the first page.
Thanks for your help!
Newbie
Top achievements
Rank 1
 asked on 22 Feb 2012
1 answer
132 views
2 problems here;
1. Header row (column titles) are not exported to Excel when I have more than 10 items in a export. I thought it might be related to the page size so I changed my page size to encompass 12 rows and still no header row.
2. I am unable to get the entire dataset to export to excel. I can only get the 1st page. See code snipit

ActiveBatchesRadGrid_ItemCommand calls the method ConfigureExport in the base class so all exports function the same

private void ActiveBatchesRadGrid_ItemCommand(object source, GridCommandEventArgs e)
{
    switch (e.CommandName)
    {
        case RadGrid.InitInsertCommandName:
            _gridTableView = e.Item.OwnerTableView;
            break;
        case RadGrid.ExportToExcelCommandName:
            ExpandAllDetailTableRecords(source, ExpandedStates, false);
            ConfigureExport(source, e);
            break;
    }
 
 }



protected static void ConfigureExport(object source, GridCommandEventArgs e)
{
    e.Item.OwnerTableView.ExpandCollapseColumn.Visible = false;
    e.Item.OwnerTableView.GetColumn("PolicyEditRecord").Visible = false;
    e.Item.OwnerTableView.GetColumn("DeleteTransaction").Visible = false;
    e.Item.OwnerTableView.GetColumn("ManualAdjustmentBatchID").Visible = false;
    e.Item.OwnerTableView.GetColumn("ManualAdjustmentID").Visible = false;
    ((RadGrid)source).ExportSettings.ExportOnlyData = true;
    //((RadGrid)source).PageSize = ((RadGrid)source).MasterTableView.VirtualItemCount;
    ((RadGrid)source).ExportSettings.IgnorePaging = true;
    ((RadGrid)source).ExportSettings.OpenInNewWindow = false;
    ((RadGrid)source).MasterTableView.HierarchyDefaultExpanded = false;
    ((RadGrid)source).MasterTableView.ExportToExcel();
 
}

VirtualItemCount is commented out because it throws an "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values." error. I have not tried it yet but I think it may be due to the export being conducted on the DetailGrid and not the MasterGrid. Any comments on that would be appreciated too.


EDIT:
After further investigation the lack of the export of the header row does not appear to be a row count issue. It appears that only the first DetailGrid of the first row of the MasterDetailGrid exports the column headers. I have tried this on all of my implementations and the behavior is consistent across them
Tim
Top achievements
Rank 2
 answered on 22 Feb 2012
3 answers
101 views
I am trying to modify the filter menus in a grid.  I have done this before (successfully), so I copied the event code from the other web page that was working fine, pasted it into a second .aspx, and everytime it executes it goes into a CPU loop -- which I cannot locate the source of using normal debugging techniques.

I have attached a screen capture of the grid at run-time so you can visualize it.

The source code for the actual grid is immediately below, and the related event code which is causing the problem is included below that.  If I comment out the event code, the page runs fine.  If I let the While..Loop execute, a cpu-loop will result without any debug stops being executed.

Any help would be most appreciated!  It will probably turn out to be something stupid I am doing, but for the life of me, I cannot find it.

Thanks for any assistance in advance!

Lynn

<telerik:RadGrid ID="gvCCECCommitteeProperties" GridLines="None" AutoGenerateColumns="false" PageSize="15" EnableEmbeddedSkins="true" Skin="Default"
    Width="99%" AllowFilteringByColumn="true" AllowAutomaticDeletes="false" AllowMultiRowEdit="false" AllowMultiRowSelection="false"
    AllowPaging="true" AllowSorting="false" runat="server" OnItemCreated="gvCCECCommitteeProperties_ItemCreated"
    DataSourceID="SqlDataSource1" AllowAutomaticUpdates="true" AllowAutomaticInserts="False"
    OnInit="gvCCECCommitteeProperties_Init"
    SelectCommandType="StoredProcedure" SelectCommand="SelectEmployees"
    UpdateCommandType=""
    UpdateCommand="UPDATE [CCECCommitteeProperties] SET [LastName] = @LastName, [FirstName] = @FirstName, [MiddleName] = @MiddleName, [Suffix] = @Suffix, [IsDependent] = @IsIndependent, [IsUnopposed] = @IsUnapplosed, [IsOneParty] = @IsOneParty, [IsPrimaryWinner] = @IsPrimaryWinner, [IsGeneralWinner] = @IsGeneralWinner, [IsActive] = @IsActive, [IsQualifiedForBallot] = @IsQualifiedForBallot, [IsReallocated] = @IsReAllocated, [IsIncumbent] = @IsIncumbent WHERE [CCECCommitteePropertyID] = @CCECCommitteePropertyID"
    ShowStatusBar="true">
    <MasterTableView ShowFooter="false" DataKeyNames="CCECCommitteePropertyID" EditMode="InPlace" CommandItemDisplay="TopAndBottom">
        <Columns>
            <telerik:GridEditCommandColumn FooterText="EditCommand footer" UniqueName="EditCommandColumn"
                HeaderText="Edit" HeaderStyle-Width="100px" UpdateText="Update">
            </telerik:GridEditCommandColumn>
 
            <telerik:GridTemplateColumn HeaderStyle-Width="250px" HeaderText="Names<br>(Last Name)" AllowFiltering="true" DataField="LastName">
                <ItemTemplate>
                    <div style="width: 250px">
                        <asp:Label Width="100px" ID="Label1" runat="server" Text="Last Name;" ></asp:Label>  <asp:Label Width="100px" ID="txtLastName" runat="server" Text='<%# Bind("LastName") %>'></asp:Label>
                        <br />
                        <asp:Label Width="100px" ID="Label2" runat="server" Text="First Name:" ></asp:Label>  <asp:Label Width="100px" ID="txtFirstName" runat="server" Text='<%# Bind("FirstName") %>'></asp:Label>
                        <br />
                        <asp:Label Width="100px" ID="Label4" runat="server" Text="Middle Name:" ></asp:Label>  <asp:Label Width="100px" ID="txtMiddleName" runat="server" Text='<%# Bind("MiddleName") %>'></asp:Label>
                        <br />
                        <asp:Label Width="100px" ID="Label3" runat="server" Text="Suffix:" ></asp:Label>  <asp:Label Width="100px" ID="txtSuffix" runat="server" Text='<%# Bind("Suffix") %>'></asp:Label>
                    </div>
                </ItemTemplate>
                <EditItemTemplate>
                    <div style="width: 250px" >
                        <asp:Label Width="100px" ID="Label1" runat="server" Text="Last Name;" ></asp:Label>  <asp:TextBox Width="100px" ID="LastName" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                        <br />
                        <asp:Label Width="100px" ID="Label2" runat="server" Text="First Name:" ></asp:Label>  <asp:TextBox Width="100px" ID="FirstName" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox>
                        <br />
                        <asp:Label Width="100px" ID="Label4" runat="server" Text="Middle Name:" ></asp:Label>  <asp:TextBox Width="100px" ID="MiddleName" runat="server" Text='<%# Bind("MiddleName") %>'></asp:TextBox>
                        <br />
                        <asp:Label Width="100px" ID="Label3" runat="server" Text="Suffix:" ></asp:Label>  <asp:TextBox Width="100px" ID="Suffix" runat="server" Text='<%# Bind("Suffix") %>'></asp:TextBox>
                    </div>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
 
 
            <telerik:GridTemplateColumn HeaderText="Information<br>(Filer Id)" AllowFiltering="true" DataField="CommitteeID">
                <ItemTemplate>
                    <div style="float: left;">
                    FilerID:  <asp:Label ID="lblFilerID" runat="server" Text='<%# Eval("CommitteeID") %>'></asp:Label>
                        <br />
                    Party:  <asp:Label ID="lblCandidateParty" runat="server" Font-Bold="False" Text='<%# Eval("PartyName") %>'></asp:Label>
                    </div>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridCheckBoxColumn AllowFiltering="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="IsActive" HeaderText="Active?" ></telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn AllowFiltering="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="IsIndependent" HeaderText="Independent?" ></telerik:GridCheckBoxColumn>
 
            <telerik:GridCheckBoxColumn AllowFiltering="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="IsUnopposed" HeaderText="Unopposed?" ></telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn AllowFiltering="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="IsOneParty" HeaderText="One Party<br>Dominant?" ></telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn AllowFiltering="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="IsPrimaryWinner" HeaderText="Primary<br>Winner?" ></telerik:GridCheckBoxColumn>
 
            <telerik:GridCheckBoxColumn AllowFiltering="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="IsGeneralWinner" HeaderText="General<br>Winner?" ></telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn AllowFiltering="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="IsQualifiedForBallot" HeaderText="Qualified<br>for Ballot?" ></telerik:GridCheckBoxColumn>
 
            <telerik:GridCheckBoxColumn AllowFiltering="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="IsReallocated" HeaderText="Reallocated?" ></telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn AllowFiltering="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataField="IsIncumbent" HeaderText="Incumbent?" ></telerik:GridCheckBoxColumn>
 
            <telerik:GridBoundColumn Visible="false" DataField="OfficeID" ></telerik:GridBoundColumn>
 
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


Now the relevant event code:

protected void gvCCECCommitteeProperties_Init(object sender, System.EventArgs e)
{
    GridFilterMenu menu = gvCCECCommitteeProperties.FilterMenu;
    int i = 0;
 
    while (i < menu.Items.Count)
    {
        if (i == 0)
        {
            if (menu.Items[i].Text == "NoFilter" || menu.Items[i].Text == "Contains" || menu.Items[i].Text == "StartsWith" || menu.Items[i].Text == "EqualTo")
            {
                i++;
            }
            else
            {
                menu.Items.RemoveAt(i);
            }
        }
    }
}

Casey
Top achievements
Rank 1
 answered on 22 Feb 2012
2 answers
85 views
Are telerik's asp.net ajax controls compatible with Microsoft's asp.net wizard control?  I need to be able to utilize the wizard control to handle a particular data entry issue, but don't know if Telerik's controls will work without issues when used in that environment.

Are there any caveats, concerns, issues, workarounds, etc. that I need to be aware of?

Thanks in advance!

Lynn

Postscript:  I assume since this has sat here for 2+ days without any response that the answer is "no"?
Lynn
Top achievements
Rank 2
 answered on 22 Feb 2012
1 answer
51 views
I searched for several hours in the forum and kb for a example like this

Ext.net Lookup grid

here two grids are there in a window and they save some selection button.
i tried to build up same thing but as a new user of rad controls cannot produce the same.
my whole project stuck on this problem.
kindly help so that i can start..
Pavlina
Telerik team
 answered on 22 Feb 2012
3 answers
323 views
Hi Guys,

Could someone tell me how to remove a tool from the RadEditor dynamically. When someone logs into my page, I want to be able to turn a tool off. Any help would be greatly appreciated.

William
Richard
Top achievements
Rank 1
 answered on 22 Feb 2012
0 answers
101 views
am binding my telerik data grid  to my datasource  
in that am getting 
the name  repeated  in columns
Name 
zya
zya
zya
zya
zya

the same goes for type
name  type

zya    domes
zya    domes
zya    overeas
zya    overeas 
zya    overeas 
zya    overeas
i only want my name to be repeated once ..how can i do this !
Anonymous
Top achievements
Rank 1
 asked on 22 Feb 2012
7 answers
354 views
I'm having the same issues outlined in many other threads. That is that my column headers do not align with my column's content. I'm using the latest telerik build and I've had no issues with IE or Firefox however Chrome and Safari (windows) don't work. I've tried the following steps which I've found in this forum:
  • Made sure non of my columns are using the ItemStyle-Width (only HeaderStyle-Width).
  • Set my MasterTableView 'TableLayout' to Fixed.
  • Handled the OnGridCreated client event to force the grid to repaint.

None of these options fixed the issue. One setting that seemed to get me closer was removing HeaderStyle-Wrap=False and ItemStyle-Wrap=False. Again setting each of these to false got me much closer however they were still way off. Any help with this would be greatly appreciated as time is of the essence. Thank you.

Hunter
Top achievements
Rank 1
 answered on 22 Feb 2012
3 answers
123 views
Hello!

We want to use ClickToOpen on the root level of a menu.
At the same time we are using an ItemTemplate for the root level.

This combination doesn't work at all. Nothing happens when clicking the menu-item.
When looking at the source code it is obvious that it doesn't work since no a-tag is generated if it is templated.

Will this be fixed? And is there a workaround to get this to work until it is fixed?

Regards
Rikard
Tan PS
Top achievements
Rank 1
 answered on 22 Feb 2012
3 answers
226 views
Hi there,
 I'm using RadListBox with checkboxes=true..By default I have loading the items and some of the items have checked..I need to restrict  uncheck option for checked items.How can i achieve this?.

   Thanks,
Suresh.S

Richard
Top achievements
Rank 1
 answered on 22 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?