Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
97 views
There is an issue where the contents of the controls spill over the size of the window if it is being called for the first time (like an insert or update event). However every subsequent call the window seems to adjust to the perfect height. Any thoughts on how to solve this issue? 

<telerik:RadGrid ID="rgContacts" runat="server" AutoGenerateColumns="False" OnNeedDataSource="rgContacts_NeedDataSource" Skin="Silk"
    ShowHeader="false" GridLines="None" BorderStyle="Groove" BorderWidth="1px" Width="250px" BorderColor="#555555"
    AlternatingItemStyle-BackColor="White" BackColor="#bbeaf3">
    <MasterTableView DataKeyNames="contact_id" EditMode="PopUp">
    <CommandItemSettings ShowRefreshButton="false" AddNewRecordText="Add a New Contact"/>
    <EditFormSettings PopUpSettings-Modal="true" UserControlName="controls/Contacts/CustomerContact.ascx" EditFormType="WebUserControl"  InsertCaption="Create New Contact" CaptionFormatString="Edit Contact" FormCaptionStyle-Font-Bold="true" FormCaptionStyle-Font-Size="X-Large" FormStyle-BackColor="#dedddc" />
Angel Petrov
Telerik team
 answered on 01 May 2013
3 answers
326 views

Hi,

My requirement is to export RadGrid data to excel when user clicks on button outside RadGrid.

The following are the customizations that are needed:

1) Save or Open dialogue box should show up for opening or saving excel file.
2) Add company logo to excel file at certain position. Like row1 column1 to row5 column5. Logo size (gif format) is
      always going to be same. Currently we are doing it by accessing worksheet and adding it.
3) we should be able to specify from where data should start showing up like row7..
4) We are hiding some columns in the grid. When exported, these shouldn't be exported.
5) Some rows in the grid are disabled. User can't click them. They shouldn't be exported.
6) Add a title and format it.
7) Format print options like margin etc..

I appreciate your help. Please let me know if there are any links about how to take care of it.

Thanks,
Prathiba.

Kostadin
Telerik team
 answered on 01 May 2013
1 answer
148 views
I created a gauge and set the pointer value when the users saves information.  For some reason, when the page posts back, the gauge loses it's original formatting and goes to a default.  Does anyone know why it does this?

I do not set formatting in anyway in the code behind.  Just the pointer value.

radGuage.Pointer.Value =

Convert.ToDecimal(7.5);

 

<

 

telerik:RadRadialGauge ID="radGuage" runat="server" Skin="WebBlue">

 

 

 

 

 

<Pointer Color="Green">

 

 

 

 

 

<Cap Color="Lime" />

 

 

 

 

 

</Pointer>

 

 

 

 

 

<Scale MajorUnit="1" Max="8" Min="1" MinorUnit=".5">

 

 

 

 

 

<Labels Color="Black" Position="Outside" Visible="False" />

 

 

 

 

 

<Ranges>

 

 

 

 

 

<telerik:GaugeRange Color="#ccffcc" From="1" To="2" />

 

 

 

 

 

<telerik:GaugeRange Color="#99ccff" From="2" To="3" />

 

 

 

 

 

<telerik:GaugeRange Color="#0067b4" From="3" To="4" />

 

 

 

 

 

<telerik:GaugeRange Color="#826eb1" From="4" To="5" />

 

 

 

 

 

<telerik:GaugeRange Color="#ffff99" From="5" To="6" />

 

 

 

 

 

<telerik:GaugeRange Color="#ff9900" From="6" To="7" />

 

 

 

 

 

<telerik:GaugeRange Color="#ff6666" From="7" To="8" />

 

 

 

 

 

</Ranges>

 

 

 

 

 

</Scale>

 

 

 

 

 

</telerik:RadRadialGauge>

 

Niko
Telerik team
 answered on 01 May 2013
0 answers
314 views
I'm not sure if this is a bug or if this is the way it's supposed to be, but if you set the selected index, then change the selected value of a combobox, the combobox does not select that value, but instead changes the value of the currently selected index. I would think changing the selected value would have the combobox select the item with that value instead of changing the value of the currently selected item. I can also see how it might go the other way so you can change the value of the selected item, but it seems more useful if the combobox actually selected the value you set in selected value. Or did i just do something wrong?

I guess here's my specific question, I have two radcombobox's. when the page loads, i first set the selected index to 0, then check to see if i need to select a specific item in the lists. if i do, i set the selected value of the radcombobox's to the value of that item. however, every time in the codebehind when i try to get the value of the selected item, it always gives me the value of the item at 0 (unless i set the selected value, which it will give me that value instead, even if i haven't changed the selected item).

anyway, if that makes any sense, i actually fixed the problem by not setting the selected index at all (since i was setting it to 0 anyway).

update: nope, there's still a problem. setting the selected value does not show as the selected item in the combobox, although i am now getting the correct selected value in the code behind, when i refresh the window, the "selected item" is the first item in the list. but if i pull down, it shows the correct selected item highlighted

update 2: sorry, the problem was because EnableLoadOnDemand was set to true, now it works fine (stupid... i've been trying to figure this out the last day and a half, and now that i decide to register to this site to post this problem, i fix it before i even get a response, haha)
Iedoc
Top achievements
Rank 1
 asked on 01 May 2013
6 answers
207 views
Hello,

I am quiet confused with saving the dock state in cookie. I just need the C# code to save the dock state in the cookie and I want it to be persisted for a particular time duration.

Please help with code,
JC.
Dobromir
Telerik team
 answered on 01 May 2013
1 answer
115 views
My problem is on the design of radAlert

See the picture attached please.

As you can see there are another two extra buttons behind the normal ones, does someone knows why is this happening? please.

The radAlert from the picture happens when I click a buttonColumn from a RadGrid, see the code.

<telerik:GridButtonColumn ConfirmText="¿Eliminar registro?" ConfirmDialogType="RadWindow" ConfirmTitle="Eliminar"
                ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="140px" ConfirmDialogWidth="250px"  ItemStyle-HorizontalAlign="Center" />

Thanks
Bozhidar
Telerik team
 answered on 01 May 2013
3 answers
145 views
We have two RadGrids sitting side by side in a table, with a RadFilter for each. The RadFilters start out invisible, and are shown by a button on the RadToolbar inside the command templates of their respective grids.  The two grids have set widths, which allow them to fit side by side on the screen. However, when you display the RadFilter, it creates extra width on both sides of the RadToolbar/command template of the associated RadGrid, pushing them out of position. Any ideas why or what to do about it?

The two grids appear on the second RadPageView of a RadMultiePage control.

The relevant code:

<table cellpadding="0" cellspacing="0" border="0" width="990">
        <tr>
            <td class="legendcolor" style="width: 450; text-align: center">
                Activity Codes
            </td>
            <td class="legendcolor" style="width: 450; text-align: center">
                Pay Groups
            </td>
        </tr>
        <tr>
            <td valign="top" style="width: 450; text-align: center">
                <telerik:RadFilter Width="450" runat="server" ID="RadFilter2" Visible="false" FilterContainerID="RadGridActivity"
            EnableEmbeddedSkins="true" ShowApplyButton="false" />
            <telerik:RadGrid ID="RadGridActivity" runat="server" OnItemCommand="RadGridActivity_ItemCommand" OnItemDataBound="RadGridActivity_ItemDataBound" OnItemCreated="RadGridActivity_ItemCreated" OnUpdateCommand="RadGridActivity_UpdateCommand"
            AutoGenerateColumns="False" PageSize="15" AllowPaging="True" AllowSorting="True" OnExcelExportCellFormatting="RadGridActivity_ExcelExportCellFormatting" OnInsertCommand="RadGridActivity_InsertCommand"
            CellSpacing="0" DataSourceID="ldsActivityCodes" GridLines="None" AllowFilteringByColumn="true" OnCSVExportCellFormatting="RadGridActivity_CSVExportCellFormatting" OnDeleteCommand="RadGridActivity_DeleteCommand">
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
            <MasterTableView DataKeyNames="ID" DataSourceID="ldsActivityCodes" TableLayout="Fixed" IsFilterItemExpanded="false" CommandItemDisplay="Top" OverrideDataSourceControlSorting="true">
                <CommandItemTemplate>
                    <telerik:RadToolBar runat="server" ID="RadToolBar2" Height="24px" EnableEmbeddedSkins="true" OnButtonClick="RadToolBar2_ButtonClick" EnableRoundedCorners="true">
                        <Items>
                            <telerik:RadToolBarButton Text="Show filter" CommandName="OpenRadFilter" />
                            <telerik:RadToolBarButton Text="Apply filter" CommandName="FilterRadGrid" />
                            <telerik:RadToolBarButton Text="Clear Filter" CommandName="ClearFilter" />
                            <telerik:RadToolBarButton Text="Hide filter" CommandName="CloseRadFilter" />
                            <telerik:RadToolBarButton Width="40px" Text="" CommandName="" />
                            <telerik:RadToolBarButton Text="" CommandName="">
                                <ItemTemplate>
                                    <telerik:RadButton ID="ExcelExportButton2" runat="server" Image-EnableImageButton="true" Image-ImageUrl="images/Export2Excel.gif" ToolTip="Export to Excel this page. Click Yes at MS 'different format' error message." Width="44px" Height="22px" CommandName="ExportToExcel" />
                                    <telerik:RadButton ID="RadButton2" runat="server" Width="1px" Height="1px" />
                                    <telerik:RadButton ID="CSVExportButton2" runat="server" Image-EnableImageButton="true" Image-ImageUrl="images/Export2CSV.gif" ToolTip="Export to CSV this page" Width="44px" Height="22px" CommandName="ExportToCSV" />
                                    <telerik:RadButton ID="RadButton5" runat="server" Width="1px" Height="1px" />
                                    <telerik:RadButton ID="AddButton" runat="server" Image-EnableImageButton="true" Image-ImageUrl="images/2Add.gif" ToolTip="Add New Employee" Width="44px" Height="22px" CommandName="InitInsert" />
                                </ItemTemplate>
                            </telerik:RadToolBarButton>
                        </Items>
                    </telerik:RadToolBar>
                </CommandItemTemplate>
                <Columns>
                    <telerik:GridBoundColumn DataField="FullName" FilterControlAltText="Filter FullName column"
                        HeaderText="FullName" Visible="false" SortExpression="FullName" AllowFiltering="false" UniqueName="FullName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" FilterControlAltText="Filter ID column"
                        HeaderText="ID" Visible="false" SortExpression="ID" AllowFiltering="false" UniqueName="ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Code" DataType="System.Int32" FilterControlAltText="Filter Code column"
                        HeaderText="Activity Code" ReadOnly="true" SortExpression="Code" UniqueName="Code">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column"
                        HeaderText="Description" ReadOnly="true" SortExpression="Description" UniqueName="Description">
                        <HeaderStyle HorizontalAlign="Center" Width="200" VerticalAlign="Top" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Width="200" Wrap="False" />
                    </telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderText="Edit" ButtonType="ImageButton" />
                    <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" HeaderText="Delete" CommandName="Delete" ButtonType="ImageButton" />
                </Columns>
                <EditFormSettings EditFormType="Template">
                    <FormTemplate>
                        <table>
                            <tr>
                                <td class="gtempname">
                                    Activity Code #:
                                </td>
                                <td align="left">
                                       <telerik:RadNumericTextBox ID="txtActivityCode" runat="server" Width="30px" CssClass="gtextbox" Type="Number" NumberFormat-DecimalDigits="0" DbValue='<%# Bind("Code") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="gtempname">
                                    Description:
                                </td>
                                <td align="left">
                                       <asp:TextBox Width="150px" ID="txtACDescription" runat="server" CssClass="gtextbox" Text='<%# Bind("Description") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <center>
                                        <asp:Button ID="btnUpdate" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                            CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                        </asp:Button>  
                                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false"
                                            CommandName="Cancel"></asp:Button></center>
                                </td>
                            </tr>
                        </table>
                    </FormTemplate>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>
                 </td>
            <td valign="top" style="width: 450; text-align: center">
                <telerik:RadFilter Width="450" runat="server" ID="RadFilter3" Visible="false" FilterContainerID="RadGridPayGroups"
            EnableEmbeddedSkins="true" ShowApplyButton="false" />
        <telerik:RadGrid ID="RadGridPayGroups" runat="server" OnExcelExportCellFormatting="RadGridPayGroups_ExcelExportCellFormatting" OnItemCreated="RadGridPayGroups_ItemCreated" OnDeleteCommand="RadGridPayGroups_DeleteCommand"
            AutoGenerateColumns="False" PageSize="15" AllowPaging="True" AllowSorting="True" OnItemCommand="RadGridPayGroups_ItemCommand" OnItemDataBound="RadGridPayGroups_ItemDataBound" OnUpdateCommand="RadGridPayGroups_UpdateCommand"
            CellSpacing="0" DataSourceID="ldsPayGroups" GridLines="None" AllowFilteringByColumn="true" OnCSVExportCellFormatting="RadGridPayGroups_CSVExportCellFormatting" OnInsertCommand="RadGridPayGroups_InsertCommand">
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
            <MasterTableView DataKeyNames="ID" DataSourceID="ldsPayGroups" TableLayout="Fixed" IsFilterItemExpanded="false" CommandItemDisplay="Top" OverrideDataSourceControlSorting="true">
                <CommandItemSettings ExportToPdfText="Export to PDF" />
                <CommandItemTemplate>
                    <telerik:RadToolBar runat="server" ID="RadToolBar3" Height="24px" EnableEmbeddedSkins="true" OnButtonClick="RadToolBar3_ButtonClick" EnableRoundedCorners="true">
                        <Items>
                            <telerik:RadToolBarButton Text="Show filter" CommandName="OpenRadFilter" />
                            <telerik:RadToolBarButton Text="Apply filter" CommandName="FilterRadGrid" />
                            <telerik:RadToolBarButton Text="Clear Filter" CommandName="ClearFilter" />
                            <telerik:RadToolBarButton Text="Hide filter" CommandName="CloseRadFilter" />
                            <telerik:RadToolBarButton Width="40px" Text="" CommandName="" />
                            <telerik:RadToolBarButton Text="" CommandName="">
                                <ItemTemplate>
                                    <telerik:RadButton ID="ExcelExportButton3" runat="server" Image-EnableImageButton="true" Image-ImageUrl="images/Export2Excel.gif" ToolTip="Export to Excel this page. Click Yes at MS 'different format' error message." Width="44px" Height="22px" CommandName="ExportToExcel" />
                                    <telerik:RadButton ID="RadButton3" runat="server" Width="1px" Height="1px" />
                                    <telerik:RadButton ID="CSVExportButton3" runat="server" Image-EnableImageButton="true" Image-ImageUrl="images/Export2CSV.gif" ToolTip="Export to CSV this page" Width="44px" Height="22px" CommandName="ExportToCSV" />
                                    <telerik:RadButton ID="RadButton4" runat="server" Width="1px" Height="1px" />
                                    <telerik:RadButton ID="AddButton" runat="server" Image-EnableImageButton="true" Image-ImageUrl="images/2Add.gif" ToolTip="Add New Employee" Width="44px" Height="22px" CommandName="InitInsert" />
                                </ItemTemplate>
                            </telerik:RadToolBarButton>
                        </Items>
                    </telerik:RadToolBar>
                </CommandItemTemplate>
                <Columns>
                    <telerik:GridBoundColumn DataField="FullName" FilterControlAltText="Filter FullName column" FilterControlWidth="1"
                        HeaderText="FullName" Visible="false" AllowFiltering="false" SortExpression="FullName" UniqueName="FullName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" FilterControlAltText="Filter ID column" FilterControlWidth="1"
                        HeaderText="ID" Visible="false" AllowFiltering="false" SortExpression="ID" UniqueName="ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="PayGroupCode" DataType="System.Int32" FilterControlAltText="Filter PayGroupCode column"
                        HeaderText="PayGroupCode" ReadOnly="True" SortExpression="PayGroupCode" UniqueName="PayGroupCode" FilterControlWidth="100">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column" FilterControlWidth="200"
                        HeaderText="Description" ReadOnly="true" SortExpression="Description" UniqueName="Description">
                        <HeaderStyle HorizontalAlign="Center" Width="200" VerticalAlign="Top" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Width="200" Wrap="False" />
                    </telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderText="Edit" ButtonType="ImageButton" FilterControlWidth="75" />
                    <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" HeaderText="Delete" CommandName="Delete" ButtonType="ImageButton" FilterControlWidth="75" />
                </Columns>
                <EditFormSettings EditFormType="Template">
                    <FormTemplate>
                        <table>
                            <tr>
                                <td class="gtempname">
                                    PayGroupCode #:
                                </td>
                                <td align="left">
                                       <telerik:RadNumericTextBox ID="txtPayGroupCode" runat="server" Width="30px" CssClass="gtextbox" Type="Number" NumberFormat-DecimalDigits="0" DbValue='<%# Bind("PayGroupCode") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="gtempname">
                                    Description:
                                </td>
                                <td align="left">
                                       <asp:TextBox Width="150px" ID="txtPGDescription" runat="server" CssClass="gtextbox" Text='<%# Bind("Description") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <center>
                                        <asp:Button ID="btnUpdate" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                            CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                        </asp:Button>  
                                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false"
                                            CommandName="Cancel"></asp:Button></center>
                                </td>
                            </tr>
                        </table>
                    </FormTemplate>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>
            </td>
        </tr>
    </table><br />
HISEagle
Top achievements
Rank 1
 answered on 01 May 2013
3 answers
198 views
Hi,

I am using a asp.net TextBox control inside GridTemplateColumn and OnTextChanged event capuring the text entered by user.
save in memory and bind it back to the RadGrid onItemDataBound.

But after the Grid binds and shows up on screen. I cannot type in textbox control of any row and cannot type in the filter boxes, Radgrid is freezing.

It works after I click the mouse outside the grid and click on filter box or grid template textbox.

                    <telerik:RadGrid ID="rgPhysicalAccessReviewList" runat="server" ShowStatusBar="true" Visible="false"  OnInit="rgPhysicalAccessReviewList_Init"
                    AutoGenerateColumns="False"  AllowSorting="True" AllowMultiRowSelection="False" AllowMultiRowEdit="true" AllowFilteringByColumn="true"
                    OnItemCommand="rgPhysicalAccessReviewList_ItemCommand" OnItemDataBound="rgPhysicalAccessReviewList_ItemDataBound" EnableViewState="true"
                    AllowPaging="true" PageSize="150" OnNeedDataSource="rgPhysicalAccessReviewList_NeedDataSource">
                    <PagerStyle Mode="NumericPages"></PagerStyle>
                    <MasterTableView Width="100%" DataKeyNames="EmployeeID, AccessReviewID" EnableColumnsViewState="true" AllowMultiColumnSorting="True" HeaderStyle-Font-Bold="true" EditMode="EditForms">
                   
                        <NoRecordsTemplate>
                            <div>No records to display</div>
                        </NoRecordsTemplate>
                                    <Columns>
<telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-HorizontalAlign="Left" HeaderText="Business Manager Comments" HeaderStyle-Width ="300px"  HeaderButtonType="TextButton" UniqueName="CommentsBox">
                                            <ItemTemplate>
                                                     <asp:TextBox ID="txtBxComments" OnTextChanged="txtBxComments_OnTextChanged" Text='<%# Eval("ManagerComments") %>' AutoPostBack="true" runat="server" TextMode="MultiLine" Wrap="True" MaxLength="500" Height="50px" Width="300px"></asp:TextBox>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>   
                                        <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-HorizontalAlign="Left" HeaderText="Previous Quarter Comments" HeaderStyle-Width ="300px"  HeaderButtonType="TextButton" UniqueName="PQCommentsBox">
                                            <ItemTemplate>
                                                     <asp:Label ID="lblComments" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                      
                                    </Columns>                                   
                    <NestedViewTemplate>
                        <telerik:RadGrid ID="rgEmployeeDetails" AutoGenerateColumns="False" runat="server" AllowPaging="True" BorderWidth="0px" OnNeedDataSource="rgEmployeeDetails_NeedDataSource">
                            <MasterTableView Width="75%" DataKeyNames="EmployeeID" ShowHeader="false" AllowMultiColumnSorting="True" > 
                                    <Columns>
                                            <telerik:GridTemplateColumn HeaderStyle-BorderWidth="0px">
                                                <ItemTemplate>
                                                    <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap">
                                                        <div class="contactWrap">
                                                            <fieldset style="padding: 10px;">
                                                                <legend style="padding: 5px;"><b>Details of Employee:&nbsp; &nbsp;<%#Eval("LastName")%>,&nbsp;<%#Eval("FirstName")%></b>
                                                                </legend>
                                                                <table>
                                                                    <tbody>
                                                                        <tr>
                                                                            <td>
                                                                                <table class="fontDetails">
                                                                                    <tbody>
                                                                                      <tr>
                                                                                             <td style="font-weight: bold;">
                                                                                                Access Coordinator:
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="Label2" Text='<%#Bind("AccessCoordinator") %>' runat="server"></asp:Label>
                                                                                            </td>
                                                                                            <td style="font-weight: bold;">
                                                                                                AC Phone:
                                                                                            </td>
                                                                                            <td>
                                                                                                <asp:Label ID="Label4" Text='<%#Bind("ACPhone") %>' runat="server"></asp:Label>
                                                                                            </td>
                                                                                        </tr>
<%--                                                                                         <tr>
                                                                                            <td style="font-weight: bold;">
                                                                                                Previous Quarter Comments:
                                                                                            </td>
                                                                                            <td colspan="3">
                                                                                                <asp:Label ID="lblPQComments" Text='<%#Bind("PQComments") %>' runat="server" ></asp:Label>
                                                                                            </td>
                                                                                        </tr>--%>
                                                                                    </tbody>
                                                                                  </table>
                                                                                </td>
                                                                            </tr>
                                                                      </tbody>
                                                                </table>
                                                            </fieldset>
                                                        </div>
                                                    </asp:Panel>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>    
                                    </Columns>                                 
                                </MasterTableView>                          
                        </telerik:RadGrid>
                    </NestedViewTemplate>  
                </MasterTableView>
                <ClientSettings>
                    <Scrolling AllowScroll="true" SaveScrollPosition="true"   UseStaticHeaders = "true" />                   
                </ClientSettings>
                <GroupingSettings CaseSensitive="false" />
                </telerik:RadGrid>

--------------------------------------------------- code behind ---------------------------------------------------

 public void txtBxComments_OnTextChanged(object sender, EventArgs e)
            {
                TextBox txtComments = (TextBox)sender;
                GridDataItem item = (GridDataItem)txtComments.NamingContainer;

                //Remove existing key-value pair if reediting the controls
                if (reviewListChanges.Count > 0)
                {
                    foreach (KeyValuePair<string, string> pair in reviewListChanges)
                    {
                        string[] keyValue = pair.Value.Split('|');
                        if (pair.Key.Equals(item["AccessReviewID"].Text) && keyValue[0].Equals("TextBox"))
                        {
                            reviewListChanges.Remove(pair);
                            break;
                        }
                    }                   
                }

                reviewListChanges.Add(new KeyValuePair<string, string>(item["AccessReviewID"].Text, "TextBox" + "|" + txtComments.Text));
            }

            protected void rgPhysicalAccessReviewList_ItemDataBound(object sender, GridItemEventArgs e)
                {
                  try
                    {

                        if ((e.Item is GridDataItem))
                        {
 if (reviewListChanges.Count > 0)
                            {
                                foreach (KeyValuePair<string, string> pair in reviewListChanges)
                                {
                                    string[] keyValue = pair.Value.Split('|');

                                    if (pair.Key.Equals(gridEditFormItem.OwnerTableView.DataKeyValues[gridEditFormItem.ItemIndex]["AccessReviewID"].ToString()))
                                    {
                                        if (keyValue[0] == "TextBox")
                                        {                                           
                                            txtBx.Text = keyValue[1];                                           
                                        }
                                        else
                                        {                                          
                                            ddlList.SelectedValue = keyValue[1];                                          
                                        }
                                    }
                                }
                            }
                        }
                    }



Please let me know, if any issues.

Appreciate your quick response on this.
Maria Ilieva
Telerik team
 answered on 01 May 2013
1 answer
132 views
I recently created a custom drop down filter for use in a RadGrid.  I followed the example from these two links:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filteringtemplatecolumns/defaultcs.aspx
http://www.telerik.com/help/aspnet/grid/grdfilteringwithdropdownlist.html

The grid shows a list of sites.  The drop down displays a list of statuses that can pertain to requests belonging to the site.  See attached screen shot. The column displays a count showing how many of that site's requests have the selected status. 

The grid has an ExportToExcel button.  When clicking that button, the custom control throws the following exception:
 
2013-04-26 10:01:37.923,0000000F,OPSWeb,Unhandled Application Exception [Page Info: /OPSWeb/OPSMain.aspx],Error,Unable to cast object of type 'Telerik.Web.UI.CompressedPageState' to type 'System.Collections.IDictionary'.
10:21

The error occurs in this method on the last line where it adds the combox to the list of controls in the cell..  

        protected override void SetupFilterControls(TableCell cell)
        {
            rcBox = new RadComboBox();
            rcBox.ID = ID;
            rcBox.AutoPostBack = true;
            rcBox.Width = FilterControlWidth;
            rcBox.SelectedIndexChanged += rcBox_SelectedIndexChanged;
            rcBox.DataSource = StatusList;
            cell.Controls.Add(rcBox);
        }

How do I get the export to work?  Why is this causing the export to fail?

Thank you.
Kostadin
Telerik team
 answered on 01 May 2013
3 answers
220 views
I'm having an issue where on slower servers the loading panel seems to stay visible and keeps spinning while also locking up the rest of the web functionality.

Here's how I reproduce it:
1. Click on folder and let it finish loading contents
2. Click on another folder with a lot of items and before it finishes loading, click back on the first folder.

The loading panel just spins and spins thus making the application useless.

The way it's setup is:
1. Folder Tree is in a Web User Control (.ascx)
2. Clicking a folder in the tree causes the correct grid control, also a Web User Control (.ascx), to load inside of the control with the tree

So 1 .ascx is calling another based on the selected tree node.
Maria Ilieva
Telerik team
 answered on 01 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?