Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
172 views
Hello Team, I have a problem handling the sorting of my RadGrid that has a generic Dictionary as a DataSource, I bind the data handling the NeedDataSource event and works fine for binding the data and also for auto paging, I have enabled AllowSorting but when I click the only column there is I get "Sys.WebForms.PageRequestManagerServerErrorException: Cannot find column Value." following I share my declarative binding and the datasource handling on the code behind, I hope you can send some light to solve this issue.

At the aspx:

            <telerik:RadGrid ID="gvwTrainingProgramsRad" runat="server" AutoGenerateColumns="false"  AllowPaging="true" AllowSorting="true" >
                <pagerstyle mode="NextPrevAndNumeric" position="Top"></pagerstyle>
                <mastertableview width="100%" DataKeyNames="Key" AllowSorting="true" >
                    <Columns>
                        <telerik:GridBoundColumn AllowSorting="true" DataType="System.String" UniqueName="ProgramName" SortExpression="Value" HeaderText="Program Name" DataField="Value" />
                    </Columns>
                </mastertableview>
            </telerik:RadGrid>

At the CodeBehind:

        void gvwTrainingProgramsRad_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
             gvwTrainingProgramsRad.DataSource = GetPrograms();
        }

The GetPrograms() method returns a Dictionary<int, string>, like I said it works well for binding but not for sorting, what am I doing wrong?


Thanks for your help


Full stacktrace:


[IndexOutOfRangeException: Cannot find column Value.]
   System.Data.DataTable.ParseSortString(String sortString) +523
   System.Data.DataView.CheckSort(String sort) +28
   System.Data.DataView.set_Sort(String value) +125
   Telerik.Web.UI.GridEnumerableFromDataView.PerformTransformation() +3662
   Telerik.Web.UI.GridEnumerableFromDataView.TransformEnumerable() +21
   Telerik.Web.UI.GridTableView.GetEnumerator(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ArrayList dataKeysArray) +105
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +169
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +500
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +58
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +27
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
   Telerik.Web.UI.GridTableView.PerformSelect() +4
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +71
   Telerik.Web.UI.GridTableView.DataBind() +238
   Telerik.Web.UI.GridSortCommandEventArgs.ExecuteCommand(Object source) +126
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +134
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +38
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +115
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +166
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +170
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3437

 

Julio Montelongo
Top achievements
Rank 1
 answered on 02 Oct 2009
4 answers
106 views
I want to allow navigation of the treeview using the Up & Down keys on the keyboard.  So I followed the instructions shown here, specifically setting TabIndex="1" and AccessKey="T".  But unlike the demo on your website, it didn't change anything.

What more do I need to do?

Robert
Robert
Top achievements
Rank 1
 answered on 02 Oct 2009
0 answers
74 views
Does PanelBar have ability to do RSS inside one of its node?

I want to do the consuming RSS where user can expand or hide it + other features with same ability (hide or expand).  I don't know that I pick the right tool to do this or not.  However, the panelBar has this ability to hide or expand.  But I am not sure the the panelbar can do the RSS with xml datasource.  Most of example of RSS consuming usually done by using data grid.  Is it possible to have data grid inside panel bar?  Please refer to the picture for more detail: http://img209.imageshack.us/img209/3775/65105342.jpg

Any advice would be very great.  Any sample of the work would be very awesome.  Thanks
Urt
Top achievements
Rank 1
 asked on 02 Oct 2009
2 answers
94 views
Hello

I have the similar problem as mentioned in the thread http://www.telerik.com/community/forums/aspnet/grid/querystring-value-problem.aspx but I am unable to find the work around.

Basically when I Ajaxify my telerik grid with the RadAjaxManager and my page is using some QueryStrings then the Sorting/Paging of the grid stops working. I have the latest telerik dll version with me. What could be the problem?

Thanks

Muhammad Arif
Muhammad Arif
Top achievements
Rank 1
 answered on 02 Oct 2009
2 answers
103 views
I have enabled drag and drop in the mastertable and do not want to allow it in the detailtable.
How do I disable it?
mk
Top achievements
Rank 1
 answered on 02 Oct 2009
3 answers
121 views
For some rason when I hit the export buttons I'm getting the columns names but the data is missing. Any idea what is wrong (see code below):

     <telerik:RadGrid ID="RadGrid2" Width="950px" runat="server" AutoGenerateColumns="False" OnNeedDataSource="RadGrid2_NeedDataSource" AllowSorting="True" OnItemCommand="RadGrid2_ItemCommand" OnItemCreated="RadGrid2_ItemCreated" Skin="Office2007" > 
                      
            <MasterTableView DataKeyNames="unit_id" CellSpacing="-1">  
                      
                    <RowIndicatorColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                    </RowIndicatorColumn> 
                          
                      <Columns> 
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn6" HeaderText="col1" AllowFiltering="False">  
                            <ItemTemplate> 
                                <asp:HyperLink ID="HyperLink6" runat="server"><%# Eval("unit_label") %></asp:HyperLink> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                          
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn3" HeaderText="col2" AllowFiltering="False">  
                            <ItemTemplate> 
                                <asp:HyperLink ID="HyperLink3" runat="server"><%# Eval("date") %></asp:HyperLink> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                          
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn4" HeaderText="col3" AllowFiltering="False">  
                            <ItemTemplate> 
                                <asp:HyperLink ID="HyperLink4" runat="server"><%# Eval("event") %></asp:HyperLink> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                          
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn5" HeaderText="col4" AllowFiltering="False">  
                            <ItemTemplate> 
                                <asp:HyperLink ID="HyperLink5" runat="server"><%# Eval("address") %></asp:HyperLink> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                          
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn8" HeaderText="col5" AllowFiltering="False">  
                            <ItemTemplate> 
                                <asp:HyperLink ID="HyperLink8" runat="server"><%# Eval("data_status")%></asp:HyperLink> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                    </Columns> 
                      
                    <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                    </ExpandCollapseColumn> 
                      
                    </MasterTableView> 
                      
    </telerik:RadGrid>  


 
        protected void Button1_Click(object sender, System.EventArgs e)  
        {  
            RadGrid2.ExportSettings.ExportOnlyData = true;  
            RadGrid2.ExportSettings.OpenInNewWindow = true;  
            RadGrid2.ExportSettings.FileName = "View_" + DateTime.Now;  
            RadGrid2.MasterTableView.ExportToExcel();  
 
        }  
 
        protected void Button2_Click(object sender, System.EventArgs e)  
        {  
            RadGrid2.ExportSettings.ExportOnlyData = true;  
            RadGrid2.ExportSettings.OpenInNewWindow = true;  
            RadGrid2.ExportSettings.FileName = "View_" + DateTime.Now;  
            RadGrid2.MasterTableView.ExportToWord();  
        }  
 
        protected void Button3_Click(object sender, System.EventArgs e)  
        {  
            RadGrid2.ExportSettings.ExportOnlyData = true;  
            RadGrid2.ExportSettings.OpenInNewWindow = true;  
            RadGrid2.ExportSettings.FileName = "View_" + DateTime.Now;  
            RadGrid2.MasterTableView.ExportToCSV();  
        }  
 
        protected void Button4_Click(object sender, System.EventArgs e)  
        {  
            RadGrid2.ExportSettings.ExportOnlyData = true;  
            RadGrid2.ExportSettings.OpenInNewWindow = true;  
            RadGrid2.ExportSettings.FileName = "View_" + DateTime.Now;  
            RadGrid2.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML;  
            RadGrid2.MasterTableView.ExportToExcel();  
        }  
 
        protected void Button5_Click(object sender, System.EventArgs e)  
        {  
            RadGrid2.ExportSettings.ExportOnlyData = true;  
            RadGrid2.ExportSettings.OpenInNewWindow = true;  
            RadGrid2.ExportSettings.FileName = "FleetView_" + DateTime.Now;  
            RadGrid2.MasterTableView.ExportToPdf();  
        } 
Pavlina
Telerik team
 answered on 02 Oct 2009
1 answer
111 views

Hi,

I am having problem when exporting radgrid to excel, the varchar fields in radgrid converted to numeric in excel.

For example, '00089' in radgrid in converted to '89' in excel.

Please give any suggestions to fix this.

Thanks in advance.

Regards,
Rags
Daniel
Telerik team
 answered on 02 Oct 2009
1 answer
192 views
Hello,

Does anyone know how to check client-side if the grid is in edit mode?  I have a grid with row drag/drop enabled, but I want to essentially disable the drag/drop functionality if the user is editing a row (InPlace editing).
Daniel
Telerik team
 answered on 02 Oct 2009
1 answer
82 views
We have discovered an issue with pasteHtml, which we believe is a bug. Steps to reproduce:

  1. Create a Table in RadEditor using the toolbar (with at least 2 columns).
  2. Position the cursor in any but the last column, and have it positioned after the space (nbsp) that by default is added to each cell.
  3. Run some code using the pasteHtml() client-side function.

This results in that the content added by pasteHtml() is placed in the NEXT CELL rather than the one that had focus (!)

(It also seems to happen outside tables. I.e. if the cursor is positioned at the very end of a <P></P> block, the content will be added to the succeeding paragraph...)

Regards,
Sigmund Lunde
Omega AS
Rumen
Telerik team
 answered on 02 Oct 2009
1 answer
53 views
Hi,

When I change my grid's PageSize, the grid looses the track of edititem.
for example
I have a grid of pagesize 10, when i am on page 2 of my grid and changes 4th item to edit mode and after that i changes my pagesize to 20. Idealy it should display 20 items and make 14th item in edit mode but the gird load with 4th item in edit mode.

thanks
virendra

Iana Tsolova
Telerik team
 answered on 02 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?