Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
133 views

i have Radgrid with 4 level, in level1 and 2 i have using SqlDatasource (drop drop)

Even RadGrid1_DetailTableDataBind i want to bingding data source of level 3 and 4.

 

 <telerik:RadGrid ID="RadGrid1"   OnDetailTableDataBind="RadGrid1_DetailTableDataBind" runat="server" DataSourceID="SqlDataSource1" CellSpacing="0" GridLines="None">
                                        <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="id">
                                            <DetailTables>
                                                <telerik:GridTableView runat="server" DataKeyNames="id2" DataSourceID="SqlDataSource2">
                                                    <DetailTables>
                                                        <telerik:GridTableView runat="server">
                                                            <DetailTables>
                                                                <telerik:GridTableView runat="server"></telerik:GridTableView>
                                                            </DetailTables>
                                                        </telerik:GridTableView>
                                                    </DetailTables>
                                                    <ParentTableRelation>
                                                        <telerik:GridRelationFields MasterKeyField="id" DetailKeyField="id_cha2"></telerik:GridRelationFields>
                                                    </ParentTableRelation>
                                                </telerik:GridTableView>
                                            </DetailTables>
                                        </MasterTableView>
                                    </telerik:RadGrid>
                                   
                                    <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString='<%$ ConnectionStrings:default %>' SelectCommand="sp_getproduct" SelectCommandType="StoredProcedure">
                                        <SelectParameters>
                                            <asp:SessionParameter SessionField="month" DefaultValue="9" Name="thang" Type="Int32"></asp:SessionParameter>
                                            <asp:QueryStringParameter QueryStringField="nsd" DefaultValue="cuongcp" Name="nsd" Type="String"></asp:QueryStringParameter>
                                            <asp:Parameter DefaultValue="1" Name="action" Type="Int32"></asp:Parameter>
                                        </SelectParameters>
                                    </asp:SqlDataSource>
                                    <asp:SqlDataSource runat="server" ID="SqlDataSource2" ConnectionString='<%$ ConnectionStrings:default %>' SelectCommand="sp_getproduct" SelectCommandType="StoredProcedure">
                                        <SelectParameters>
                                            <asp:SessionParameter SessionField="month" DefaultValue="9" Name="thang" Type="Int32"></asp:SessionParameter>
                                            <asp:QueryStringParameter QueryStringField="nsd" DefaultValue="cuongcp" Name="nsd" Type="String"></asp:QueryStringParameter>
                                            <asp:Parameter DefaultValue="2" Name="action" Type="Int32"></asp:Parameter>
                                        </SelectParameters>
                                    </asp:SqlDataSource>

 

and code behind

 protected void RadGrid1_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            if (e.DetailTableView.DataSourceID == "")
            {
                GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
                string OrderID = dataItem.GetDataKeyValue("id2").ToString();
                e.DetailTableView.DataSource = GetDataTable(OrderID);
               
            }

            if (e.DetailTableView.DataSourceID == "")
            {
                GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
                string id = dataItem.GetDataKeyValue("id3").ToString();
                e.DetailTableView.DataSource = GetDataTable_detailt(id);
            }
        }

but at level 4 error. plz  help me, thanks in advance

Daniel
Telerik team
 answered on 28 Oct 2016
1 answer
84 views

Hello, 

I have a rad grid where grouping is being used.  The first column is a linkbutton which after 1 layer of being clicked into is then replaced with text to both disable and remove the link.  

When I collapse and then re-expand the group the column values are now all gone. 

Prior to collapsing my markup looks like 

<td class="GrdBtn">

<span style="cursor:default;">Sept 2016</span>

</td>

After clicking the collapse and then expanding the markup is 

<td class="GrdBtn">

<a href="javascript:__doPostBack('ReportGrid$ctl00$ctl05$ctl00','')"></a>

</td>

 

I cannot identify an event to which this occurs.  The column is defined in the apsx as 

   <telerik:GridButtonColumn ButtonType="LinkButton" ImageUrl="" HeaderText="Region" DataTextField="RegionName" ItemStyle-CssClass="GrdBtn" CommandName="Select" UniqueName="btnSelect" SortExpression="RegionName" HeaderStyle-Width="150px" />

 

The event to which changes the linkbutton to a span is within the RadGrid_DataBound event and looks like 

btn = CType(CType(Page.Form.FindControl("ReportGrid"), RadGrid).MasterTableView.Items(i).Cells(3).Controls(0), LinkButton)
CType(Page.Form.FindControl("ReportGrid"), RadGrid).MasterTableView.Items(i).Cells(3).Controls.Remove(btn)
Dim finalTxt As String = String.Format("<span style='cursor:default;'>{0}</span> ", btn.Text)
Dim litControl As New LiteralControl(finalTxt)

What event could be causing this?  Or how can i prevent this behavior from happening?

 

Viktor Tachev
Telerik team
 answered on 28 Oct 2016
1 answer
187 views

Hi,

 

I am creating tabs dynamically through AddTab, AddPageView approach (http://demos.telerik.com/aspnet-ajax/tabstrip/examples/multipage/dynamic-pageview-creation/defaultcs.aspx). I have 8 tabs in which last tab is just a image.. I want disable the Click event on last tab. 

Could you please tell me how to approach?

 

Thanks and Regards,

Puru

Anton
Telerik team
 answered on 28 Oct 2016
1 answer
115 views

I have a situation where I have some very long columns. In ItemDataBound I just substring the first 80 characters and put it in the item.text, and the full in the ToolTip. The problem is when I export to Excel I want to get the entire contents of the data item, not the truncated version that's in the cell. How can I avoid this It seems that in ItemDataBound I can't test on 

The other option I've thought of is to somehow put the entire contents of the data item in the cell and maybe not have it wrap.

What would be the recommended solution?

Rodney

 

Viktor Tachev
Telerik team
 answered on 28 Oct 2016
5 answers
687 views
Hi all,

      I am having a radgrid with a grid button column meant for playing an audio file. I gave the command name as "Play" and in the grid_itemcommand event handler i tried to open a radwindow having the media player from code behind. But since my grid is configured with rad ajax manager and rad ajax loading panel to make ajax postbacks i am not getting the radwindow. When i removed the radajax manger and loading panel the window appears as expected.

 But i dont want the page to get reloaded for even for a sort operation. Is there anything similar to the triggers of update panel for loading panel or any other ways please suggest.

Regards,
Saravanan K
Pavlina
Telerik team
 answered on 28 Oct 2016
7 answers
4.6K+ views
Hi,

I have an empty RadGrid. A message appears by default when the grid is empty : "No records to display". I would like to change the content of the message. How may I to do please ?

Thank you in advance,
Viktor Tachev
Telerik team
 answered on 28 Oct 2016
8 answers
728 views

Hello,

I am using a RadDropDownTree control.  And my items look like this:

 

1. Statements
        -Allocations
        -Tax
2.Other
        -Other Reports
        -Tax Estimates

I want to prevent the user from selecting the parent items.  In the above example, that would be the "Statements" and "Other".  I want users to be able to only select the children.

Another issue i am having is on child selection, the control does not collapse it's dropdown.

Any idea on how to achieve this?

Thanks,

 

Crackneo
Top achievements
Rank 1
 answered on 27 Oct 2016
5 answers
152 views

I have noticed some very peculiar behavior when setting the folder of the FileExplorer from a record selected on a RadGrid.  The behavior is consistent so should be able to be determined why.

Each row on the RadGrid points to a project which has as one of its not visible fields a url to its project folder on AWS.

The code to change the folder location is contained in a method that is called from RadGrid2_ItemCommand.

The FileExplorer shows the contents of the changed folder all the time but with one exception.  If the currently selected Project is the first on the list, then the FileExplorer does not show the contents of the new folder whenever a different Project is selected.  Reselecting the same Project will get FileExplorer to show the contents of the new folder.  If the currently selected Project is anything other than the first Project, the FileExplorer will show the contents of the new folder.

I have logged the value of FileExplorer1.CurrentFolder before the change and then again after the change.  When selecting away from the first Project, this value does not change.  All other times the value changes.  What may be relevant is that on the Page_Load, I also log the value of FileExplorer1.CurrentFolder, if it is a Postback, and saw that the value has since been changed but the visual aspect of the FileExplorer still shows the first Project's folder.

On Page_Load (not a Postback), the Forward, NewFolder and Open are all removed from the ToolBar,ContextMenus[0] and GridContextMenu.

How do I get the FileExplorer to show the contents of the new folder when selecting away from the first Project?

 

<telerik:RadFileExplorer RenderMode="Lightweight" runat="server" ID="FileExplorer1"
   Width="595px" Height="350px" AllowPaging="true" PageSize="10"
   VisibleControls="ContextMenus,Grid,Toolbar">
   <Configuration EnableAsyncUpload="true"></Configuration>
</telerik:RadFileExplorer>

 

protected void RadGrid2_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == "RowClick")
    {
       GridDataItem item = (GridDataItem)e.Item;
      switch (e.Item.OwnerTableView.Name)
      {
         case "Missions":
            // do something else
            break;
         case "Projects":
            string tempLocation = item["colFullDirectory"].Text;
            string newDrive = String.Format("~/aws/{0}", tempLocation.Substring(9));
            SetFileExplorerPaths(newDrive);

...

 

private void SetFileExplorerPaths(string folderPath)
{
   string[] paths = new string[]
   {
      folderPath
   };
   FileExplorer1.InitialPath = Page.ResolveUrl(folderPath);
   FileExplorer1.Configuration.UploadPaths = paths;
   FileExplorer1.Configuration.ViewPaths = paths;
   FileExplorer1.Configuration.DeletePaths = paths;
}

 

 

Vessy
Telerik team
 answered on 27 Oct 2016
2 answers
75 views

I have a hierarchy grid with 3 levels similar to the "Grid - Declarative Relations" demo.  I am using batch edit mode and have set HighlightDeletedRows="True".  However in the inner most grid it is not highlighting the row to be deleted.  This is the BatchEditingSettings at each level.

<BatchEditingSettings EditType="Cell" SaveAllHierarchyLevels="True" HighlightDeletedRows="True" OpenEditingEvent="Click"></BatchEditingSettings>

Is there some way I can get it to highlight the row to be deleted in the inner most grid?

Thanks,  Jeff

Jeff H.
Top achievements
Rank 1
 answered on 27 Oct 2016
15 answers
288 views

Hello,

I've updated to latest version of UI for ASP.NET AJAX R3 2016 and I get now following javascript error...

TypeError: this._contextMenuFunctionality.dispose is not a function

 /Telerik.Web.UI.WebResource.axd?....:29491:33 dispose()
 /Telerik.Web.UI.WebResource.axd?....:6:68785 disposeElement()
 /Telerik.Web.UI.WebResource.axd?....:15:35395 _updatePanel()
 /Telerik.Web.UI.WebResource.axd?....:15:32430 _scriptIncludesLoadComplete()
 /Telerik.Web.UI.WebResource.axd?....:6:204 .()
 /Telerik.Web.UI.WebResource.axd?....:6:307
 /Telerik.Web.UI.WebResource.axd?....:15:4881 _loadScriptsInternal()
 /Telerik.Web.UI.WebResource.axd?....:15:5671 _scriptLoadedHandler()
 /Telerik.Web.UI.WebResource.axd?....:6:307 ._completedCallback()
 /Telerik.Web.UI.WebResource.axd?....:6:94288 _scriptLoadHandler()

I'm using a TreeView and some context menus in a Update Panel and this error occures when I'm clicking a tree node.

These are the client side events of RadTreeView I'm using:

OnClientContextMenuItemClicking="onContextMenuItemClick"
OnClientContextMenuShowing="onClientContextMenuShowing"
OnClientDoubleClick="onClientDoubleClickHandler"
OnClientNodeClicking="clientNodeClickingHandler"
OnClientNodeExpanding="toggleHandler"
OnClientNodeCollapsing="toggleHandler"
OnClientNodeExpanded="onNodeExpandedCollapsed"
OnClientNodeCollapsed="onNodeExpandedCollapsed"

Hope this helps,

Best regards

Roman Haussener

Marin Bratanov
Telerik team
 answered on 27 Oct 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?