Telerik Forums
UI for ASP.NET AJAX Forum
12 answers
2.6K+ views
I'm trying to update to the latest version of the ASP.NET AJAX controls and have hit a problem with the Control Panel tool.   As cool of an idea as it is, my company is blocking whatever websites/ports the tool uses.   What this effectively means is that I can't download or install any of the stuff we have purchased.  Convincing the networking team to open things up (assuming of course I can figure out what the Control Panel needs opened) may not be an option.  So how do I go about just downloading the install file without using the Control Panel tool?
Yana
Telerik team
 answered on 06 Oct 2016
1 answer
153 views

 

Case 1)

If I place the below grid on a aspx page, the grid data is loaded client side and paging and sorting appear to be working as expected.

Case 2)

However, if I put the below grid on a web User Control, then place the control on an aspx page, paging and sorting do not work, the page number will change, but the data isn't refreshed in the grid, also if you click a heading to sort, the sort direction icon is shown, but the grid data does not refresh.

Case 3) (this is my end goal)

If you put the below grid in a ContentTemplate of a Menuitem, sort or paging does not work, and the page numbers won't change when changing pages, and the item count isn't correct.  (this is my end goal).  if I use server side binding, needdatasource everything works fine, but I'm really trying to get client side binding to avoid postbacks.  No editing of data, just view only.

 

Also, the template column that is commented out, throws an error when the page first loads, as it's binding to an empty datasource is my guess, says fph_Private isn't part of the DataSource.

 

 

 

 
<telerik:RadGrid ID="rgRecent1" runat="server" ClientDataSourceID="RadClientDataSource2"  AllowPaging="true" AllowSorting="true" PageSize="5">
                           <MasterTableView >
                              <Columns>
                                <%--  <telerik:GridTemplateColumn>
                                       <ItemTemplate>
                                           <asp:Image ID="imgShared" runat="server" ImageUrl="~/Images/Shared.png" Visible='<%# IIf(CType(Eval("fph_Private"), Boolean), 0, 1)%>' ToolTip="Shared" BorderWidth="0" Width="16px" />
                                       </ItemTemplate>
                                       <HeaderStyle HorizontalAlign="Left" Width="20px" />
                                       <ItemStyle HorizontalAlign="Left" Width="20px" />
                                   </telerik:GridTemplateColumn>--%>
                                   <telerik:GridBoundColumn UniqueName="pt_Type" DataField="pt_Type" HeaderText="<br />Type">
                                       <HeaderStyle HorizontalAlign="Left" Width="75px" />
                                       <ItemStyle HorizontalAlign="Left" Width="75px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="ItemsCount" DataField="ItemsCount" HeaderText="Items<br />Count">
                                       <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                       <ItemStyle HorizontalAlign="Left" Width="50px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="rm_RepNumber" DataField="rm_RepNumber" HeaderText="<br />Rep NO">
                                       <HeaderStyle HorizontalAlign="Left" Width="75px" />
                                       <ItemStyle HorizontalAlign="Left" Width="75px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="ot_Abbreviation" DataField="ot_Abbreviation" HeaderText="Lead<br />Time">
                                       <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                       <ItemStyle HorizontalAlign="Left" Width="50px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="fph_ProjectNumber" DataField="fph_ProjectNumber" HeaderText="<br />Project NBR">
                                       <HeaderStyle HorizontalAlign="Left" Width="100px" />
                                       <ItemStyle HorizontalAlign="Left" Width="100px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="fph_ProjectName" DataField="fph_ProjectName" HeaderText="<br />Project Name">
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="LastFirstMiddle" DataField="LastFirstMiddle" HeaderText="<br />Initiator">
                                       <HeaderStyle HorizontalAlign="Left" Width="200px" />
                                       <ItemStyle HorizontalAlign="Left" Width="200px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="fpr_AccessDate" DataField="fpr_AccessDate" DataFormatString="{0: MM/dd/yyyy hh:mm tt}" HeaderText="<br />Last Access Date">
                                       <HeaderStyle HorizontalAlign="Left" Width="125px" />
                                       <ItemStyle HorizontalAlign="Left" Width="125px" />
                                   </telerik:GridBoundColumn>
                               </Columns>
                           </MasterTableView>  
                               <ClientSettings>
                                   <DataBinding ShowEmptyRowsOnLoad="false" ></DataBinding>
                               </ClientSettings>
                               <PagerStyle AlwaysVisible="true" Mode="NextPrevNumericAndAdvanced"  />
                       </telerik:RadGrid>
 
                        <telerik:RadClientDataSource ID="RadClientDataSource2" runat="server" AllowPaging="true" PageSize="5" >
                           <DataSource>
                               <DataSourceControlSettings DataSourceID="ObjectDataSource_FPHR"  />
                           </DataSource>
                       </telerik:RadClientDataSource>
   <asp:ObjectDataSource  ID="ObjectDataSource_FPHR" runat="server" SelectMethod="GetFieldProjectRecent" TypeName="AppClassObjects.FieldProjectHeaderRecent" >
       <SelectParameters>
           <asp:SessionParameter Name="u_UsersID" DefaultValue="32" SessionField="UserID" Type="Int32" />
       </SelectParameters>
 
   </asp:ObjectDataSource>

Marin
Telerik team
 answered on 06 Oct 2016
3 answers
830 views

In a telerik:RadGrid, I specify that every line will have a detail table:

<telerik:RadGrid ID="grd" AutoGenerateColumns="False" runat="server"
    OnDetailTableDataBind="grd_OnDetailTableDataBind" AllowMultiRowSelection="True">
  <MasterTableView DataKeyNames="id1,id2">
    <Columns>
      <telerik:GridClientSelectColumn UniqueName="DetailCheckColumn"/>
      <telerik:GridBoundColumn HeaderText="Date" DataField="foo"/>
      <telerik:GridBoundColumn HeaderText="Time" DataField="bar"/>
      <telerik:GridBoundColumn HeaderText="Activity" DataField="xod"/>
    </Columns>
    <DetailTables>
      <telerik:GridTableView ShowHeadersWhenNoRecords="True"
          DataKeyNames="id" Name="Child"/>
    </DetailTables>
  </MasterTableView>
  <ClientSettings>
    <Selecting AllowRowSelect="true"/>
  </ClientSettings>
</telerik:RadGrid>

In the handler for the OnDetailTableDataBind event, I specify the data source for the DetailTableView. The handler is called when a line is expanded. Setting a list of anonymous objects as data source works fine, but a list of Dictionary will not.

I get a yellow page, It seems like the grid table view tries to find a property id of Dictionary

DataBinding: System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] does not have a property with the name id.

If I remove the DataKeyNames attribute in the detail table, I will get a detail table with the correct number of lines, but the fields will be all blank (screenshot is attached).

The event handler where I create the detail table for each expanded line. Observe that I name columns c1, c2 etc. I create the columns in the first loop round.

protected void grd_OnDetailTableDataBind(object sender,
    GridDetailTableDataBindEventArgs e)
{
  var tv = e.DetailTableView;
  var parentItem = e.DetailTableView.ParentItem;
 
  var bis = dal.get_booking_informations();
 
  tv.Columns.Add(new GridClientSelectColumn());
 
  var columnNameDict = new Dictionary<string,string>();
 
  var firstDict = true;
  var dicts = bis.GroupBy(bi=>bi.platsBokadID).Select(group =>
  {
    var dict = new Dictionary<string, string>();
 
    dict["id"] = "" + group.Key;
 
    var list = group.ToList();
 
    if (firstDict)
    {
      firstDict = false;
 
      var num = 0;
      var columns = list.Select(header=>
      {
        var shortName = "c" + ++num;
        columnNameDict[header.HeaderName] = shortName;
 
        return new GridBoundColumn
        {
          DataField = shortName,
          HeaderText = header.HeaderName
        };
      });
 
      foreach(var column in columns)
        tv.Columns.Add(column);
    }
 
    foreach(var header in list)
    {
      var shortName = columnNameDict[header.HeaderName];
      dict[shortName] = header.Value;
    }
 
    return dict;
  });
 
  tv.DataSource = dicts;
}

I have also tried to use dynamic objects instead of Dictionaries (with the same result):

protected void grdActivitiesToCopy_OnDetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
{
        var tv = e.DetailTableView;
        var parentItem = e.DetailTableView.ParentItem;
 
        var bis = dal.get_booking_informations();
 
        tv.Columns.Add(new GridClientSelectColumn());
 
        var columnNameDict = new Dictionary<string,string>();
 
        var firstDict = true;
        var dicts = bis.GroupBy(bi=>bi.platsBokadID).Select(group =>
        {
                var dict = new Dictionary<string, object>();
 
                dict["id"] = "" + group.Key;
 
                var list = group.ToList();
 
                if (firstDict)
                {
                        firstDict = false;
 
                        var num = 0;
                        var columns = list.Select(header=>
                        {
                                var shortName = "c" + ++num;
                                columnNameDict[header.HeaderName] = shortName;
 
                                return new GridBoundColumn
                                {
                                        DataField = shortName,
                                        HeaderText = header.HeaderName
                                };
                        });
 
                        foreach(var column in columns)
                                tv.Columns.Add(column);
                }
 
                var eo = new ExpandoObject();
                var eoColl = (ICollection<KeyValuePair<string, object>>)eo;
                foreach(var header in list)
                {
                        var shortName = columnNameDict[header.HeaderName];
                        dict[shortName] = header.Value;
                }
 
                foreach (var kvp in dict)
                {
                        eoColl.Add(kvp);
                }
 
                dynamic eoDynamic = eo;
 
                return eoDynamic;
        }).ToList();
 
        tv.DataSource = dicts;
}

 

Eyup
Telerik team
 answered on 06 Oct 2016
1 answer
121 views

hi everboy i'm new to RadGrid and  i found this example  at site 

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=grid

and i copy all file and this work find, but when it run this show error, plz help me, thank

 

Eyup
Telerik team
 answered on 06 Oct 2016
1 answer
126 views
Works everywhere else.  This my code around it:

 <div id="divddHealthConditions" class="inputWrapper marginRight">
                                <asp:Label ID="lblHealthConditions" runat="server" CssClass="lblddHealthConditions" Text="<%$Resources: Resources, strHealthConditions %>" AssociatedControlID="ddHealthConditions" />
                                <telerik:RadDropDownList ID="ddHealthConditions" runat="server" RenderMode="Lightweight" CssClass="ddHealthConditionsAttr" AutoPostBack="True" CausesValidation="False" DefaultMessage="<%$ Resources:Resources, strDefaultMessageDDLPleaseSelect %>" OnSelectedIndexChanged="ddHealthConditions_SelectedIndexChanged" OnClientSelectedIndexChanged="DdlGetSelectedIndexChanged"></telerik:RadDropDownList>
                                <div class="clearer">
                                    <asp:CustomValidator ID="cvDdHealthConditions" runat="server" CssClass="validator" ValidationGroup="<%$Resources: Resources, strVgHealthConditions %>" ErrorMessage="<%$Resources: Resources, strErrMsgReqField %>"
                                        ControlToValidate="ddHealthConditions" Display="Dynamic" Enabled="true" Visible="true" EnableClientScript="true">
                                    </asp:CustomValidator>
                                </div>
                            </div>
Ivan Danchev
Telerik team
 answered on 06 Oct 2016
1 answer
88 views

Hi,

I've read as many of the posts on this topic as I can but just can't get it to work for me.

Please the attached image - I want to get rid of the grey area and move the details rows left, underneath the expand-collapse icons.

Thanks in advance,

Jack

Eyup
Telerik team
 answered on 06 Oct 2016
3 answers
121 views
When executing the grid-command grid.MasterTableView.ExportToCsv() a File Save Dialog pops up. I have a function created that when the event grid_exporting() is generated I save the file and don't won't the user to have the option to save, save as or cancel. How do I disable the feature?
Eyup
Telerik team
 answered on 06 Oct 2016
0 answers
55 views

Currently, the RadPanelBar can only act as a tab strip (role="tabstrip"). (Actually, the current implementation is missing the role="tabstrip" attribute, so it's basically invalid and only a collection of incoherent tabs.)

The RadPanelBar, however, is rather a menu. It may, semantically, even rather be a tree view, too.

It depends on the usage on a web page what the RadPanelBar is actually supposed to represent.

So I suggest to add an enumeration property to the RadPanelBar enabling developers to designate it either

  • as a tabstrip (containing tabs)
  • as a menu (containing menu items)
  • as a tree view (containing tree items)

Regards,
Axel

A
Top achievements
Rank 1
 asked on 05 Oct 2016
4 answers
224 views

In BatchEdit mode when clicking "Cancel Changes" CommandName returns "RebindGrid" and not Cancel. What do I need to do to receive Cancel on server side when Cancel Changes is clicked?

 

 

Daniel
Top achievements
Rank 1
 answered on 05 Oct 2016
1 answer
143 views

Hi Team,

I am using RadGrid inside RadAjaxPanel.

But RadGrid's function OnInfrastructureExporting="RadGrid1_InfrastructureExporting" is not working after adding RadAjaxPanel.

If i delete RadAjaxPanel then everything works fine.

Please let me know where exactly i am doing a mistake.

Thanks & Regards,

Jatin

Maria Ilieva
Telerik team
 answered on 05 Oct 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?