Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
82 views
I have the data as the following

ID ProductName Active
1      "One"              1
2      "Two"              1
3      "Three"        0
4      "Four"             1

I want to hide row id=3 because active is 0 when a grid is bound.
How to accomplish this?

Thanks
Brew
Shinu
Top achievements
Rank 2
 answered on 17 Aug 2010
3 answers
218 views

Hi,

I'm working on my first project which uses Telerik controls. It is an older version. For example, the DLL is RadGrid.Net2.dll and the version is 5.0.1.0

How can I find documentation and videos etc for that version of the control? There is no indication on the support site which version it applies to (I can only assume that it is the current version).

 

Cheers

David

David
Top achievements
Rank 1
 answered on 17 Aug 2010
8 answers
182 views
Hi,
I have two RadGrids in a webform.
I want the second grid to show a few rows based on a filter criteria in the first grid.
But the first grid is in multi-row edit mode, and the user will normally only navigate between the editable cells (like a spreadsheet).
And then I can't capture any server side event that makes it possible to refresh the second grid with appropriate data.

Anyone having a solution for this?

Regards,
Erik Lidman
Erik Lidman
Top achievements
Rank 1
 answered on 16 Aug 2010
6 answers
232 views
Hi

Have a page which loads a user control using the RadAjaxManager. This user control contains a ModalPopupExtender. 

ModalPopupExtender is triggered to show (server side) when clicking a button within the loaded user control.

The modal dialog (panel) which ModalPopupExtender extends is shown without problems, but  whenever any button within modal dialog is clicked the following exception occurs server side:    

System.ArgumentException: Invalid JSON primitive: . atSystem.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()atSystem.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32depth) atSystem.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(Stringinput, Int32 depthLimit, JavaScriptSerializer serializer) atSystem.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializerserializer, String input, Type type, Int32 depthLimit) atSystem.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(Stringinput) at Telerik.Web.UI.RadWebControl.LoadPostData(String postDataKey,NameValueCollection postCollection) atTelerik.Web.UI.RadInputControl.LoadPostData(String postDataKey,NameValueCollection postCollection) atTelerik.Web.UI.RadWebControl.System.Web.UI.IPostBackDataHandler.LoadPostData(StringpostDataKey, NameValueCollection postCollection) atSystem.Web.UI.Page.ProcessPostData(NameValueCollection postData,Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(BooleanincludeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Implementation is based on the examples in this forum.

Any ideas on how to resolve this?

Best regards,

/Magnus
Magnus Lund
Top achievements
Rank 1
 answered on 16 Aug 2010
4 answers
175 views
Hey, 

I'm attempting to replicate this demo ( http://demos.telerik.com/aspnet-ajax/combobox/examples/programming/addremovedisableitemsclientside/defaultcs.aspx ). The gist is that I need to either disable or hide items after they've been selected by the user. The issue I am having is that the hiding or disabling of an item is not persisted over a postback caused by the AutoPostBack property of the ComboBox. 

This seems like it should be trivial based on the 'Preserving Changes' section of http://www.telerik.com/help/aspnet-ajax/combo_clientsidebasics.html

ComboBox declaration (LinqDataSource for feeding data): 
<telerik:RadComboBox ID="SearchPeopleAttribute" runat="server" AutoPostBack="true" Skin="Windows7" AllowCustomText="true"
                       DataSourceID="SearchPeopleAttributeDS" EnableAutomaticLoadOnDemand="true" EnableVirtualScrolling="true" EnableLoadOnDemand="true" ItemsPerRequest="30" EnableItemCaching="true" Filter="Contains"  ShowMoreResultsBox="true" DataTextField="Name" DataValueField="DepartmentPersonAttributeID"
                       EmptyMessage="Search person attribute..." OnClientSelectedIndexChanging="SearchPeopleAttribute_SC" OnSelectedIndexChanged="SearchPeopleAttribute_SelectedIndexChanged" Width="175px" />

JavaScript IndexChanging:
function SearchPeopleAttribute_SC(sender, eventArgs) {
           var item = eventArgs.get_item();
           var combo = $find("<%= SearchPeopleAttribute.ClientID %>");
           //alert(combo.get_id());
           combo.trackChanges();
           //alert(item.get_text());
           item.disable();
           combo.commitChanges();
       }

Forgot to mention, .NET 4, VS 2010, Q12010 Telerik Release. 

Any suggestions? 

Cheers. 
Sergey
Top achievements
Rank 2
 answered on 16 Aug 2010
1 answer
267 views

Hi guys,

These methods work great except for one circumstance...

Since there is no default "revert" functionality in RadFilter, I have to do my own.  I do this using the SaveSettings and LoadSettings methods, and work great, except if the the filter is blank to begin with.

  • Start with a blank filter
  • savedFilter = RadFilter.SaveSettings()
  • Add groups and expressions
  • RadFilter.LoadSettings(savedFilter)

It will not revert back to a blank filter.  You can replicate this on your demo here.

I admit its minor, and the "x" at the top level will clear them, but it interferes with the consistency of my "revert" function.

Thanks, Greg

George
Top achievements
Rank 1
 answered on 16 Aug 2010
2 answers
268 views
I am attempting to export the grid below and have it look like it does in the screen shot gridscreenshot.jpg (colors and links not important -- just need the data displayed correctly).

I am using GridTemplateColumns, and the item template area is actually four (4) different values as shown in the code below.

The problem is that during the export, these values are all being pushed together like one big number (see gridexport.jpg)

I have been browsing the other grid export related issues but I think this is different than anything else I am seeing and I am unsure how to correct it.

thanks in advance for your help!

Here is the grid I am exporting:

grid aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowCustomPaging="False" AllowMultiRowSelection="False"
    AllowPaging="False" AutoGenerateColumns="False" PageSize="500" OnItemCreated="RadGrid1_ItemCreated"
    BorderColor="Black" BorderStyle="Solid" BorderWidth="1" OnItemDataBound="RadGrid1_ItemDataBound"
    Skin="None" Width="950px" OnItemCommand="RadGrid1_ItemCommand" OnGridExporting="RadGrid1_GridExporting" OnExcelExportCellFormatting="RadGrid1_ExcelExportCellFormatting">
    <ExportSettings IgnorePaging="true" ExportOnlyData="true"  >  
        <Excel Format="Html" />                      
    </ExportSettings>                     
    <%--<PagerStyle  BackColor="White" Mode="Advanced" ShowPagerText="false" Position="Bottom" />--%>
    <MasterTableView AllowCustomSorting="False" DataKeyNames="GroupByID,RowType" EditMode="InPlace">
        <Columns>
            <telerik:GridTemplateColumn UniqueName="GroupByNameTemplate" DataField="GroupByName" HeaderText="Scope Object"
                HeaderStyle-BorderColor="Black" HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderWidth="1"
                ItemStyle-BorderColor="Black" ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1"
                ItemStyle-BackColor="White">
                <HeaderTemplate>
                    <table id="GroupByHeaderTable3" width="100%">
                        <tr>
                            <td width="100%" style="text-align: center;">
                                Scope Object
                            </td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <%# System.Web.UI.DataBinder.Eval(Container.DataItem, "GroupByName") %>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="GroupByTypeTemplate" DataField="GroupByType" HeaderText="Type"
                HeaderStyle-BorderColor="Black" HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderWidth="1"
                ItemStyle-BorderColor="Black" ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1"
                ItemStyle-BackColor="White">
                <HeaderTemplate>
                    <table id="GroupByHeaderTable3" width="100%">
                        <tr>
                            <td width="100%" style="text-align: center;">
                                Type
                            </td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <%# System.Web.UI.DataBinder.Eval(Container.DataItem, "GroupByType")%>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="DesignTemplate" HeaderStyle-BorderColor="Black" HeaderText="Design"
                HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderWidth="1" ItemStyle-BorderColor="Black"
                ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1" ItemStyle-BackColor="White">
                <HeaderTemplate>
                    <table width="100%" id="GroupByHeaderTable5">
                        <tr>
                            <td colspan="4" width="100%" style="text-align: center; border: thin solid #000000;">
                                Design
                            </td>
                        </tr>
                        <tr>
                            <td width="25%" style="text-align: center;">
                                N/A<br />
                                <asp:imagebutton id="imgChart1" title="Chart Design N/A" style="cursor: pointer;" alt="" runat="server" 
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Design" CommandArgument="0" /> 
                                      
                            </td>
                              
                            <td width="25%" style="text-align: center; color: #008000;">
                                Full<br />
                                <asp:imagebutton id="Imagebutton1" title="Chart Design Full Credit" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Design" CommandArgument="1"/>                                                
                            </td>
                            <td width="25%" style="text-align: center; color: #C59F0C";>
                                Partial<br />
                                <asp:imagebutton id="Imagebutton2" title="Chart Design Partial Credit" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Design" CommandArgument="2"/>                                                
                            </td>
                            <td width="25%" style="text-align: center; color: #800000;">
                                None<br />
                                <asp:imagebutton id="Imagebutton3" title="Chart Design No Credit" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Design" CommandArgument="3"/>                                                
                            </td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <table width="100%" id="GroupByHeaderTable6">
                        <tr>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.DesignNA") %>'
                                    ToolTip="Design N/A" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=DesignNA" />
                            </td>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.DesignFullCredit") %>'
                                    ToolTip="Design Full Credit" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=DesignFullCredit" ForeColor="Green" />
                            </td>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink3" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.DesignPartialCredit") %>'
                                    ToolTip="Design Partial Credit" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=DesignPartialCredit" ForeColor="#C59F0C" />
                            </td>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink4" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.DesignNoCredit") %>'
                                    ToolTip="Design No Credit" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=DesignNoCredit"  ForeColor="#800000"/>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="EffectivenessTemplate" HeaderStyle-BorderColor="Black" HeaderText="Effectiveness"
                HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderWidth="1" ItemStyle-BorderColor="Black"
                ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1" ItemStyle-BackColor="White">
                <HeaderTemplate>
                    <table width="100%" id="GroupByHeaderTable7">
                        <tr>
                            <td colspan="4" width="100%" style="text-align: center; border: thin solid #000000;">
                                Effectiveness
                            </td>
                        </tr>
                        <tr>
                            <td width="25%" style="text-align: center;">
                                N/A<br />
                                <asp:imagebutton id="imgE0" title="Chart Effectiveness N/A" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Effectiveness" CommandArgument="0"/>                                                
                            </td>
                            <td width="25%" style="text-align: center; color: #008000;">
                                Full<br />
                                <asp:imagebutton id="imgE1" title="Chart Effectiveness Full Credit" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Effectiveness" CommandArgument="1"/>                                                
                            </td>
                            <td width="25%" style="text-align: center; color: #C59F0C;">
                                Partial<br />
                                <asp:imagebutton id="imgE2" title="Chart Effectiveness Partial Credit" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Effectiveness" CommandArgument="2"/>                                                
                            </td>
                            <td width="25%" style="text-align: center; color: #800000;">
                                None<br />
                                <asp:imagebutton id="imgE3" title="Chart Effectiveness No Credit" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Effectiveness" CommandArgument="3"/>                                                
                            </td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <table width="100%" id="GroupByHeaderTable8">
                        <tr>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink5" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.EffectivenessNA") %>'
                                    ToolTip="Effectiveness N/A" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=EffectivenessNA" />
                            </td>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink6" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.EffectivenessFullCredit") %>'
                                    ToolTip="Effectiveness Full Credit" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=EffectivenessFullCredit" ForeColor="Green"/>
                            </td>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink7" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.EffectivenessPartialCredit") %>'
                                    ToolTip="Effectiveness Partial Credit" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=EffectivenessPartialCredit" ForeColor="#C59F0C"/>
                            </td>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink8" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.EffectivenessNoCredit") %>'
                                    ToolTip="Effectiveness No Credit" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=EffectivenessNoCredit" ForeColor="#800000"/>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="OverallTemplate" HeaderStyle-BorderColor="Black" HeaderText="Overall"
                HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderWidth="1" ItemStyle-BorderColor="Black"
                ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1" ItemStyle-BackColor="White">
                <HeaderTemplate>
                    <table width="100%" id="GroupByHeaderTable9">
                        <tr>
                            <td colspan="4" width="100%" style="text-align: center; border: thin solid #000000;
                                border-collapse: collapse;">
                                Overall
                            </td>
                        </tr>
                        <tr>
                            <td width="25%" style="text-align: center;">
                                N/A<br />
                                <asp:imagebutton id="imgO0" title="Chart Overall N/A" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Overall" CommandArgument="0"/>                                                
                            </td>
                            <td width="25%" style="text-align: center; color: #008000;">
                                Full<br />
                                <asp:imagebutton id="imgO1" title="Chart Overall Full Credit" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Overall" CommandArgument="1"/>                                                
                            </td>
                            <td width="25%" style="text-align: center; color: #C59F0C;">
                                Partial<br />
                                <asp:imagebutton id="imgO2" title="Chart Overall Partial Credit" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Overall" CommandArgument="2"/>                                                
                            </td>
                            <td width="25%" style="text-align: center; color: #800000;">
                                None<br />
                                <asp:imagebutton id="imgO3" title="Chart Overall No Credit" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Overall" CommandArgument="3"/>                                                
                            </td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <table width="100%" id="GroupByHeaderTable10">
                        <tr>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink9" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.OverallNA") %>'
                                    ToolTip="Overall N/A" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=OverallNA" />
                            </td>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink10" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.OverallFullCredit") %>'
                                    ToolTip="Overall Full Credit" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=OverallFullCredit" ForeColor="Green" />
                            </td>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink11" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.OverallPartialCredit") %>'
                                    ToolTip="Overall Partial Credit" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=OverallPartialCredit" ForeColor="#C59F0C"/>
                            </td>
                            <td width="25%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink12" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.OverallNoCredit") %>'
                                    ToolTip="Overall No Credit" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=OverallNoCredit" ForeColor="#800000"/>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="NoResponseTemplate" HeaderStyle-BorderColor="Black" HeaderText="No Response"
                HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderWidth="1" ItemStyle-BorderColor="Black"
                ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1" ItemStyle-BackColor="White">
                <HeaderTemplate>
                    <table id="GroupByHeaderTable11" width="100%">
                        <tr>
                            <td width="100%" style="text-align: center;">
                                No<br />Response<br />
                                <asp:imagebutton id="imgNR" title="Chart No Response" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="No Response"/>                                                
                            </td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <table id="GroupByHeaderTable12" width="100%">
                        <tr>
                            <td width="100%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink13" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.NoResponse") %>'
                                    ToolTip="No Response" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=NoResponse" />
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="TotalControlsTemplate" HeaderStyle-BorderColor="Black" HeaderText="Total Controls"
                HeaderStyle-BackColor="White" HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderWidth="1"
                ItemStyle-BorderColor="Black" ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1"
                ItemStyle-BackColor="White">
                <HeaderTemplate>
                    <table id="GroupByHeaderTable13" width="100%">
                        <tr>
                            <td width="100%" style="text-align: center;">
                                Total<br />Controls<br />
                                <asp:imagebutton id="imgTC" title="Chart Total Controls" style="cursor: pointer;" alt="" runat="server"
                                    ImageUrl="~/images/icons/report-icon.gif" CommandName="Total Controls" />                                                
                            </td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <table id="GroupByHeaderTable12" width="100%">
                        <tr>
                            <td width="100%" style="text-align: center;">
                                <asp:HyperLink ID="HyperLink14" runat="server" Text='<%# System.Web.UI.DataBinder.Eval(Container, "DataItem.TotalControls") %>'
                                    ToolTip="Total Controls" NavigateUrl="complianceDashboardDetail.aspx?AssessmentID={0}&GroupByName={1}&LinkID={2}&Column=TotalControls" />
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn HeaderText="GroupByIDList" DataField="GroupByIDList" Visible="false" />
            <telerik:GridBoundColumn HeaderText="GroupByName" DataField="GroupByName" Visible="false" />
            <telerik:GridBoundColumn HeaderText="ParentRow" DataField="ParentRow" Visible="false" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Attaching a screen shot of the grid (gridscreenshot.jpg)

And the relevant code behind:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem dataItem = (GridDataItem)e.Item;
        string groupByName = dataItem["GroupbyName"].Text;                
        dataItem["GroupByNameTemplate"].Text = groupByName.Replace("     ", "     ");
        for (int i = 1; i <= 14; i++)
        {           
            HyperLink hypLink = (HyperLink)dataItem.FindControl("HyperLink" + i.ToString());
            hypLink.NavigateUrl = String.Format(hypLink.NavigateUrl, assessmentID, groupByName.Replace("     ", ""), dataItem["GroupByIDList"].Text);
        }
          
        /*
        //Modify this cell if this is being downloaded or printed
        if ((radGridOptions.IsGridDownloading) || (radGridOptions.IsGridPrinting))
        {
            dataItem["DesignTemplate"].Text = dataItem["DesignNA"] + "\t" + 
                                              dataItem["DesignFullCredit"] +
                                              dataItem["DesignPartialCredit"] +
                                              dataItem["DesignNoCredit"];
        }                
         */
    }        
}
Note that the commented out code does not work -- at least not as it is written.

And last but not least, I am attaching the data as it is exported into excel (gridexport.jpg)

   Thanks!
Clint Leonard
Top achievements
Rank 1
 answered on 16 Aug 2010
1 answer
100 views
Hi
I am trying to shift the chart's origin from bottom left to top left. I am unable to do it. Is it possible?

Thanks

Any Update?
Giuseppe
Telerik team
 answered on 16 Aug 2010
5 answers
157 views
When you select a column in RadGrid as "read only" it will be hidden in Edit and Insert mode, which can be good sometimes, but other times, you want to show it, but I dont know how to do this with RadGrid? With the standard Microsoft controls this is possible, and the column will be rendered in a read only mode (like label instead of textbox).

Even better would be if you could hide a column in the "view part" of the RadGrid, and only make it visible in the Edit/Insert part, but then have the option to choose if it should be read only or not. One reason for doing this could be the lack of an Telerik DetailsView, which can be very handy when you have a table with to many columns to fit the screen horizontaly, and which you want to show verticaly instead. When you think of it, the RadGrid in EditForm or Popup mode is actually quite similar to a DetailsView, in that way that it renders verticaly instead of horizontally, and could in many cases be used as a substitute for a Detailsview. This is especially true if Telrik put in some extra development effort into the RadGrid in this area (or maybe it is already there and I just dont know about it?)
improwise
Top achievements
Rank 1
Iron
Iron
 answered on 16 Aug 2010
6 answers
167 views
I am trying to export the data from my RadGrid and keep recieving this error:

The DataSourceID of 'grdShipToCodes' must be the ID of a control of type IDataSource.  A control with ID 'dsShipToCodes' could not be found.


Is there anyway that I can exclude the column that contains this control on my export?

My Radgrid Code is below:
<telerik:RadGrid ID="grdDistrictGrowthCustomer" runat="server" 
    DataSourceID="SqlDataSource1" GridLines="None" AllowPaging="True" 
    AutoGenerateColumns="False" PageSize="100" EnableLinqExpressions="False" 
    AllowFilteringByColumn="True" AllowSorting="True">
    <ExportSettings IgnorePaging="True" OpenInNewWindow="True">
    </ExportSettings>
    <ClientSettings EnableRowHoverStyle="True">
    </ClientSettings>
    <MasterTableView DataSourceID="SqlDataSource1" ClientDataKeyNames="CustNo" CommandItemDisplay="Top"                                
        NoMasterRecordsText="There are no growth account customers in this district.">
        <CommandItemSettings 
            ShowAddNewRecordButton="False" ShowRefreshButton="False" />
        <RowIndicatorColumn>
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridTemplateColumn DataField="CustNo" HeaderText="No." 
                UniqueName="CustNo" AutoPostBackOnFilter="True" 
                CurrentFilterFunction="Contains" 
                FilterControlAltText="Type Number filter and press ENTER." 
                FilterControlWidth="55px" ShowFilterIcon="False" SortExpression="CustNo">
                <ItemTemplate>
                    <asp:Label ID="lblCustNo" runat="server" Text='<%# Eval("CustNo") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Width="100px" Wrap="True" />
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="CustName" HeaderText="Name" 
                UniqueName="CustName" AndCurrentFilterFunction="Contains" 
                AutoPostBackOnFilter="True" 
                FilterControlAltText="Type Name filter and press ENTER." 
                FilterControlWidth="110px" ShowFilterIcon="False" SortExpression="CustName">
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Width="175px" Wrap="True" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CustContact" HeaderText="Contact" 
                UniqueName="CustContact" AndCurrentFilterFunction="Contains" 
                AutoPostBackOnFilter="True" 
                FilterControlAltText="Type Contact filter and press ENTER." 
                FilterControlWidth="90px" ShowFilterIcon="False" SortExpression="CustContact">
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Width="140px" Wrap="True" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CustAddress" HeaderText="Address" 
                UniqueName="CustAddress" AllowFiltering="False" 
                SortExpression="CustAddress">
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Wrap="True" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CustCity" HeaderText="City" 
                UniqueName="CustCity" AndCurrentFilterFunction="Contains" 
                AutoPostBackOnFilter="True" 
                FilterControlAltText="Type City filter and press ENTER." 
                FilterControlWidth="70px" ShowFilterIcon="False" SortExpression="CustCity">
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Width="140px" Wrap="True" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CustState" HeaderText="State" 
                UniqueName="CustState" AndCurrentFilterFunction="Contains" 
                AutoPostBackOnFilter="True" 
                FilterControlAltText="Type State filter and press ENTER." 
                FilterControlWidth="25px" ShowFilterIcon="False" SortExpression="CustState">
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Width="40px" Wrap="True" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CustPostCode" HeaderText="Zip" 
                UniqueName="CustPostCode" AndCurrentFilterFunction="Contains" 
                AutoPostBackOnFilter="True" 
                FilterControlAltText="Type Zip filter and press ENTER." 
                FilterControlWidth="35px" ShowFilterIcon="False" SortExpression="CustPostCode">
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Width="65px" Wrap="True" />
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="Ship-to Code" UniqueName="ShipToCodes" 
                AllowFiltering="False" Groupable="False" ShowSortIcon="False">
                <ItemTemplate>
                    <asp:Label ID="lblCustomerNo" runat="server" Text='<%# Eval("CustNo") %>' Visible="False"></asp:Label>
                    <asp:SqlDataSource ID="dsShipToCodes" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:RDAConnectionString %>" 
                        SelectCommand="pr_GCP_Find_ShipTo_Codes_By_RDA_District_And_Customer" 
                        SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="INC" Name="Company" Type="String" />
                            <asp:ControlParameter ControlID="cboDistricts" DefaultValue="" Name="District" 
                                PropertyName="SelectedItem.Text" Type="String" />
                            <asp:ControlParameter ControlID="lblCustomerNo" Name="CustomerNo" PropertyName="Text" 
                                Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:GridView ID="grdShipToCodes" runat="server" DataSourceID="dsShipToCodes" 
                        AutoGenerateColumns="False" GridLines="None" ShowHeader="False">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <div style="cursor: pointer"><asp:Label ID="lblShipToCode" runat="server" Text='<%# Bind("STA_Code") %>' Font-Underline="True" Font-Size="Small"></asp:Label></div>
                                    <asp:Label ID="lblName" runat="server" Text='<%# Bind("STA_Name") %>' Visible="false"></asp:Label>
                                    <asp:Label ID="lblAddress" runat="server" Text='<%# Bind("STA_Address") %>' Visible="false"></asp:Label>
                                    <asp:Label ID="lblAddress2" runat="server" Text='<%# Bind("STA_Address2") %>' Visible="false"></asp:Label>
                                    <asp:Label ID="lblCity" runat="server" Text='<%# Bind("STA_City") %>' Visible="false"></asp:Label>
                                    <asp:Label ID="lblState" runat="server" Text='<%# Bind("STA_State") %>' Visible="false"></asp:Label>
                                    <asp:Label ID="lblPostCode" runat="server" Text='<%# Bind("STA_PostCode") %>' Visible="false"></asp:Label>
                                    <asp:Label ID="lblPhoneNo" runat="server" Text='<%# Bind("STA_PhoneNo") %>' Visible="false"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </ItemTemplate>
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Width="100px" Wrap="True" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Linked Custs." UniqueName="LinkedCust" 
                AllowFiltering="False" Groupable="False" ShowSortIcon="False">
                <ItemTemplate>
                    <asp:SqlDataSource ID="dsLinkedCustomers" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:RDAConnectionString %>" 
                        SelectCommand="pr_GCP_Find_All_Linked_Customers" 
                        SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="INC" Name="Company" Type="String" />
                            <asp:ControlParameter ControlID="lblCustomerNo" Name="CustomerNo" PropertyName="Text" 
                                Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:GridView ID="grdLinkedCustomers" runat="server" DataSourceID="dsLinkedCustomers" 
                        AutoGenerateColumns="False" GridLines="None" ShowHeader="False" 
                        EnableModelValidation="True">
                    </asp:GridView>
                </ItemTemplate>
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Width="90px" Wrap="True" />
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left" 
                    Wrap="True" />
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="BlockType" HeaderText="Blocked" 
                UniqueName="BlockType" AllowFiltering="False" 
                SortExpression="BlockType">
                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" Wrap="True" />
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="Select" HeaderText="Action" 
                Groupable="False" ShowFilterIcon="False" ShowSortIcon="False">
                <ItemTemplate>
                    <asp:LinkButton ID="btnRequestPromotion" CommandName="RequestPromotion" runat="server" Visible="false">Request Promotion</asp:LinkButton>
                    <asp:LinkButton ID="btnApprovePromotion" CommandName="ApprovePromotion" runat="server" Visible="false">Approve & Promote</asp:LinkButton>
                </ItemTemplate>
                <FilterTemplate>
                    <asp:Button ID="btnApplyFilters" runat="server" CommandName="ApplyFilter" Height="22px" Text="Apply Filters" ToolTip="Click to apply enetered filters, or press enter while in a filter texbox." Width="115px" />                                                    
                </FilterTemplate>
                <HeaderStyle Width="125px" Font-Bold="True" Font-Italic="False" 
                    Font-Overline="False" HorizontalAlign="Center" Font-Strikeout="False" Font-Underline="False" 
                    Wrap="True" />
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
                    Wrap="True" />
            </telerik:GridTemplateColumn>
        </Columns>
        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
            Font-Strikeout="False" Font-Underline="False" VerticalAlign="Top" Wrap="True" />
        <AlternatingItemStyle Font-Bold="False" Font-Italic="False" 
            Font-Overline="False" Font-Strikeout="False" Font-Underline="False" 
            VerticalAlign="Top" Wrap="True" />
    </MasterTableView>
</telerik:RadGrid>
Daniel
Telerik team
 answered on 16 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?