Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
236 views
Hi
I'm troubled a lot with this strange problem in one of my ASPX page. Background, in all pages including this one, the columns are resizable and reorderable and I have got this GridSettingsPersister.SaveSettings() for all pages to retain the user preferences.In all these pages I'm using inbuilt GridEditCommandColumn. In problem page, I'm using GridTemplateColumn as first column that has a link to open custom edit pop up. Now the problem is that when I reorder the column and save setting by gsPersister and redirect and then come back to the page; that GridTemplateColumn with edit link is gone, like it did not existed at all. I cannot figure out why my Custom(TemplateColumn) Edit Column is lost when I save the Grid Settings and revisit the page. I have other custom Template Columns as well with hyperlinks, which stay intact.
Please help.

The aspx code:
 
<div id="divlistInUsers">
                            <telerik:RadGrid ID="RGSiteConfig" runat="server" AllowPaging="True" AllowSorting="True"
                                AutoGenerateColumns="False"
                                OnNeedDataSource="RGSiteConfig_NeedDataSource" OnInsertCommand="RGSiteConfig_InsertCommand"
                                OnItemDataBound="RGSiteConfig_ItemDataBound" OnItemCommand="RGSiteConfig_ItemCommand"
                                OnPreRender="RGSiteConfig_PreRender"
                                AllowFilteringByColumn="true" EnableLinqExpressions="false"
                                Skin="Silk"
                                PageSize="10" Width=""
                                HeaderStyle-Font-Bold="true"
                                AlternatingItemStyle-BackColor="#f0f0f0">
                                <GroupingSettings CaseSensitive="false" />
                                <PagerStyle Mode="NextPrevAndNumeric" />
                                <MasterTableView CommandItemDisplay="Top" DataKeyNames="SiteID" InsertItemPageIndexAction="ShowItemOnFirstPage" CommandItemSettings-ShowRefreshButton="false">
                                    <Columns>
<%--<telerik:GridTemplateColumn HeaderStyle-Width="10px" AllowFiltering="false" AllowSorting="false" Resizable="true" Reorderable="false">
                                            <ItemTemplate>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderStyle-Width="40px" Resizable="false" Reorderable="false" />--%>
                                        <telerik:GridTemplateColumn HeaderStyle-Width="40px" AllowFiltering="false" AllowSorting="false" Resizable="true" Reorderable="false">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="lnkEdit" runat="server" Text="Edit"
CommandArgument='<%# Eval("SiteID").ToString() + "," +
Eval("ContractorID").ToString() + "," +
Eval("CountryOfOrigin").ToString() + "," +
Eval("SiteIsActive").ToString() + "," +
Eval("ContractorIsActive").ToString() + "," +
Eval("CSIEnabled").ToString() + "," +
Eval("MCSInstalled").ToString() + "," + Eval("IsCM").ToString()%>'
                                                    CommandName="EditSiteConfig" CausesValidation="false" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn SortExpression="SiteName" DataField="SiteName" HeaderText="MCS Site Name" HeaderStyle-Width="150" />
                                        <telerik:GridTemplateColumn HeaderText="Mapped PSA Companies" AllowFiltering="false" AllowSorting="false" HeaderStyle-Width="150">
                                            <ItemTemplate>
                                                <asp:Label ID="lblAssignTCACompanies" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NoOfTCAs")%>' />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn SortExpression="Total" HeaderText="Users(UPM/CP)" Visible="true" AllowFiltering="false" HeaderStyle-Width="100">
                                            <ItemTemplate>
                                                <asp:Label ID="lblAssignOperatorsToSite" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NoOfOperators") + "/" + DataBinder.Eval(Container.DataItem, "NoOfCPUsers")%>' />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn SortExpression="NoOfPermissions" HeaderText="Permissions" DataField="NoOfPermissions" AllowFiltering="false" HeaderStyle-Width="100">
                                            <ItemTemplate>
                                                <asp:Label ID="lblAssignPermissionsToSite" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NoOfPermissions")%>' />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderStyle-Width="145px" AllowFiltering="false" AllowSorting="false"
                                            Resizable="false" Reorderable="false" HeaderText="Export CM Details">
                                            <ItemTemplate>
                                                <asp:HyperLink ID="lnkExportInGrid" runat="server" Text="Export CM Details" NavigateUrl='<%# Eval("SiteID", "~/DownloadFile.aspx?SiteID={0}")%>' Target="_blank" />
                                                <input runat="server" type="hidden" id="hdTotal" value='<%# DataBinder.Eval(Container.DataItem, "Total")%>' />
                                                <input runat="server" type="hidden" id="hdNoOfIPs" value='<%# DataBinder.Eval(Container.DataItem, "NoOfIPs")%>' />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                    <EditFormSettings EditFormType="Template" CaptionFormatString="Add/Edit Site" FormCaptionStyle-Font-Bold="true">
                                        <PopUpSettings Width="555px" Modal="true" />
                                        <FormTemplate>
                                            <table cellpadding="2" cellspacing="5" border="0" width="100%" rules="none"
                                                style="border-collapse: collapse;">
                                                <tr>
                                                    <td>Site ID</td>
                                                    <td>
                                                        <asp:Label ID="lblSiteID" runat="server" Text='<%# Bind("SiteID")%>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>Contractor ID</td>
                                                    <td>
                                                        <asp:Label ID="lblContractorID" runat="server" Text='<%# Bind("ContractorID")%>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>MCS Site Name</td>
                                                    <td>
                                                        <asp:TextBox ID="txtSiteName" runat="server" Text='<%# Bind("SiteName")%>'
                                                            MaxLength="50" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>Country</td>
                                                    <td>
                                                        <asp:DropDownList ID="lbCountryCode" runat="server" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>Uses LS Web</td>
                                                    <td>
                                                        <asp:CheckBox ID="chkContractorActive" runat="server" Enabled="false" Checked='<%# (DataBinder.Eval(Container.DataItem,
"ContractorIsActive") == DBNull.Value ? true : Eval("ContractorIsActive"))%>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>Uses CSI App</td>
                                                    <td>
                                                        <asp:CheckBox ID="chkCSIEnabled" runat="server" Checked='<%# (DataBinder.Eval(Container.DataItem, "CSIEnabled").ToString() == "True" ? true : false)%>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <input runat="server" type="hidden" id="hdSiteName" value='<%# Bind("SiteName")%>' />
                                                        <input runat="server" type="hidden" id="hdCountry" value='<%# Bind("CountryOfOrigin")%>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td></td>
                                                    <td>
                                                        <asp:Button ID="btnUpdate" Text="Insert" runat="server" CommandName="PerformInsert"
                                                            CausesValidation="false" CssClass="button"></asp:Button>
                                                        <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="false"
                                                            CommandName="Cancel" CssClass="button"></asp:Button>
                                                    </td>
                                                </tr>
                                            </table>
                                        </FormTemplate>
                                    </EditFormSettings>
                                </MasterTableView>
                                <ClientSettings AllowColumnsReorder="true" ColumnsReorderMethod="Reorder" ReorderColumnsOnClient="true">
                                    <ClientEvents OnRowDblClick="" OnPopUpShowing="onPopUpShowing" />
                                    <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="True" />
                                </ClientSettings>
                            </telerik:RadGrid>
                        </div>
Kostadin
Telerik team
 answered on 22 May 2015
1 answer
40 views

I have been unable to figure out an appropriate column type for my situation. What I need is to on Item data bound check if there is a string in the column. If there is I need to display an image. When the user clicks the image I need to fire a command event which I will then download a file for the user. The issue is that when I use Grid Bound Column and add an Image Button on item data bound to the control the command event does not fire. If I click the cell the image disappears and the text shows. If I then click on the text the event fires. If i use the Image Column then I have no way to fire the command event on click. There has to be a way to do this. Any suggestions would be appreciated. Thank you.

 

Eyup
Telerik team
 answered on 22 May 2015
1 answer
78 views

Hi,

 

I am trying to implement RadCompression in my project.

I have followed the steps listed at http://www.telerik.com/help/aspnet-ajax/compression.html for Rad Compression as well as Viewstate compression.

I was able to add the code changes and build my solution.

Then I generated a report using Fiddler to capture Viewstate size, % of Uncompressed page size and File size but could not see any difference in the metrics pre and post implementation.

 

Is there anything else we should include in the code to make it work?

 

 

Maria Ilieva
Telerik team
 answered on 22 May 2015
3 answers
162 views

I have a RadMenu within a rather complex arrangement of RadPanes and RadSplitters.  

The problem is that sometimes the area which contains the RadMenu has an active horizontal scrollbar and when the RadMenu expands, the expansion is hidden.  This is an especially big problem in low-res screens.

I've found an assortment of references that refer to setting the z-index of the Radmenu in a variety of ways but these appear to be obsolete. (Such as switching style settings in and out using client side calls that no longer exist?)

Is there any way to insure the current RadMenu is always on top?

Magdalena
Telerik team
 answered on 22 May 2015
2 answers
241 views
It seems like I've run into a bug in my radgrid that does not allow me to select multiple rows.  Basically, if I click the checkboxes then I can select multiple rows.  However, if I click the row anywhere except the checkbox it selects that row but deselects all the other selected rows.  It looks like my only option right now is to forego row selecting and just implement my own custom checkbox column.  I'd rather not do this since it will require a lot of code changes (validation etc...) so I wanted to check here to see if anyone has any ideas.
My current Telerik version according to the DLL is 2011.3.1305.35.  My code is below.

<telerik:radgrid id="rgItems" runat="server" autogeneratecolumns="false" enableembeddedskins="false" onneeddatasource="rgItems_NeedDataSource" onitemdatabound="rgItems_ItemDataBound" allowmultirowselection="true">
  <clientsettings enablerowhoverstyle="true">
    <selecting allowrowselect="true" />
  </clientsettings>
  <mastertableview datakeynames="itemID,subItemID" allowsorting="true">
    <columns>
      <telerik:gridclientselectcolumn uniquename="clientSelectColumn" itemstyle-width="30px" headerstyle-width="30px" headerstyle-horizontalalign="Center" itemstyle-horizontalalign="Center" />
      <telerik:gridboundcolumn datafield="itemName" sortexpression="itemName" headertext="Item Name" />
    </columns>
  </mastertableview>
</telerik:radgrid>


Ravindra
Top achievements
Rank 1
 answered on 22 May 2015
1 answer
75 views

Hello,

i have implemented a RadGrid with DetailItemTemplate, which works fine,

but the DetailItemTemplate isn't exported to Excel / PDF.

Is this behaviour by design or am I doing anything wrong ?

 

Thanks in advance.

 

 

 

Kostadin
Telerik team
 answered on 22 May 2015
3 answers
224 views
Is there a way to assign multiple column headers in the timelineview?

For instance, I'd like  a column header indicating date, then just below it, a sub column showing the time.  

See attached images.
Nencho
Telerik team
 answered on 22 May 2015
3 answers
188 views

Hello,

I am trying to print just my RadHtmlChart using JavaScript but when I press the event button to activate the script the chart disappears, the components I want to hide successfully hide. I specifically state in my JavaScript code to only hide 2 other components but keep the chart. Also, when I cancel the prompt to print all of the components stay hidden, instead of being shown. Here is my code:

 

01.<script type="text/javascript">
02.     function printChart() {
03.          //Hide components but show chart
04.          document.getElementById("divGrid").style.display = 'none';
05.          document.getElementById("divOptions").style.display = 'none';
06.          document.getElementById("divChart").style.display = 'block';
07. 
08.          //Call the browser print method
09.          window.print();
10. 
11.          //Show components
12.          document.getElementById("divGrid").style.display = 'block';
13.          document.getElementById("divOptions").style.display = 'block';
14.          document.getElementById("divChart").style.display = 'block';
15.</script>

 

Thank you in advance!

Vessy
Telerik team
 answered on 22 May 2015
2 answers
109 views

Hello Telerik-Team,

we would like to use our own columntypes in a RadGrid in order to make the filter control a combobox.

We have the following code in the ColumnCreated-Event:

if (boundColumn.UniqueName.Equals("CaseStage"))
 
{
    grid.MasterTableView.Columns.Remove(boundColumn);
 
    CustomFilteringColumn cfBoundColumn = new CustomFilteringColumn();
    grid.MasterTableView.Columns.Add(cfBoundColumn);
     
    cfBoundColumn.DataField = "CaseStage";
    cfBoundColumn.HeaderText = "CaseStage";
}

 

When we then try to filter the Grid using one of the other filter fields we get the following error message:

Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Cannot create column with the specified type name: CustomFilteringColumn

 

Can you help us interpret the error message or perhaps suggest an alternative way to make the filtercontrol a combobox when using auto-generated columns?

 

Thank you in advance!

Roxane

 

Roxane
Top achievements
Rank 1
 answered on 22 May 2015
2 answers
310 views

I have a telerik grid. I have taken an item template column , in which a label control is taken. I don't use Eval to bind data to a column. I have set the label Id with Datafield property. I want to bind the grid via client side databinding using web method. first I am returning a serialized json string , then I Deserialized this json string in a javascript,  which is converted to a list object. then I pass this list object using set_dataSource(listobject). My requirement is that I have a search button. By clicking it , it will fire an OnClientClick event and binds the grid. My problem is that my grid is binding but no data is showing in label control of that grid. I mean to say, suppose i have four records. After clicking search button grid shows four rows but no data will be shown.

 

My grid is looking like that

<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="false" AutoGenerateColumns="true" Skin="Web20" AllowSorting="false" Visible="true" >
                        <HeaderStyle BackColor="#3ABD59" Font-Bold="True" Wrap="False" />
                        
                       <mastertableview cellspacing="-1" AllowMultiColumnSorting="true" DataKeyNames="CustomerId" ClientDataKeyNames="CustomerId">
                           
                            <Columns>

 <telerik:GridTemplateColumn HeaderText="Customer ID" UniqueName="UniCustomerId" >
                                    <ItemTemplate>
                                         <asp:Label runat="server" ID="CustomerId" Style="width:150px;" ></asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>

</Columns>
                        </mastertableview>
                        
                        <PagerStyle AlwaysVisible="True"  />
                        
                    </telerik:RadGrid>

 

I have tried with databound column like below

 

<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="false" AutoGenerateColumns="true" Skin="Web20" AllowSorting="false" Visible="true" >
                        <HeaderStyle BackColor="#3ABD59" Font-Bold="True" Wrap="False" />
                        
                       <mastertableview cellspacing="-1" AllowMultiColumnSorting="true" DataKeyNames="CustomerId" ClientDataKeyNames="CustomerId">
                           
                            <Columns> 

<telerik:GridBoundColumn DataField="CustomerId" HeaderText="Customer ID" UniqueName="UniCustomerId" DataType="System.String" >
                                </telerik:GridBoundColumn>

</Columns>
                        </mastertableview>
                        
                        <PagerStyle AlwaysVisible="True"  />
                        
                    </telerik:RadGrid>

but results are same.

 

I am stuck with this problem. Any help would be a great favor for me. 

Sampa
Top achievements
Rank 1
 answered on 22 May 2015
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?