Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
770 views

I've been searching, and I've not been able to make this work. 
I have a RadGrid with a master table, and a detail table underneath. In each row in the detail table, I would like a column that has a dropdown list noting who that particular row is "Assigned To". I'm having trouble binding a data set to this dropdown. I've tried doing it through the "receiptItems_ItemDataBound" method, because that's where the images in the row and the PDF link to download are both bound. "childitem.FindControl("ddlAsignedTo')" is not finding anything and return a null. The data set is a session variable that is populated on Page Load, unless there is a better method to do it.
See image example here

<telerik:RadGrid ID="rgReceipts" runat="server"
    AutoGenerateColumns="false"
    AllowSorting="True"
    AllowMultiRowSelection="False"
    OnDetailTableDataBind="rgReceipts_DetailTableDataBind"
    OnNeedDataSource="rgReceipts_NeedDataSource"
    OnItemDataBound="receiptItems_ItemDataBound">
    <MasterTableView DataKeyNames="JobNumber"
        HierarchyLoadMode="ServerBind"
        HierarchyDefaultExpanded="false"
        CommandItemDisplay="Top"
        ShowHeader="false">
            <NoRecordsTemplate>Could not find any receipts for that user.</NoRecordsTemplate>
                <CommandItemSettings ShowAddNewRecordButton="False" />
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="ReceiptID" Name="Receipts" Width="100%">
                            <Columns>
                                          [...]
                                <telerik:GridTemplateColumn HeaderText="Assigned To">
                                    <HeaderStyle Width="120" Font-Bold="True"/>
                                    <ItemTemplate>
                                        <telerik:RadDropDownList ID="ddlAsignedTo" runat="server" MaxHeight="225" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                          [...]

 

The snippet added to "receiptItems_ItemDataBound" that has not been successful, because the "ddlAssignedTo" control apparently can't be located and returns null:

RadDropDownList ddlAssigned = (RadDropDownList) childItem.FindControl("ddlAssignedTo");
ddlAssigned.DataSource = ddlAssignedUsersList;
ddlAssigned.DataTextField = "Text";
ddlAssigned.DataValueField = "Value";

 

If more information or snippets are needed, I can provide whatever. I wasn't sure exactly what to provide that would be helpful.

asdf

Eyup
Telerik team
 answered on 30 Jan 2019
6 answers
230 views
Hi Telerik Team,

I am using a rad combo box with MarkFirstMatch property.and i used to bind  the rad combobox  with different  countries name using ID="ddlCountry" . I used this same ID="ddlCountry
" in various asp.net pages.
 <telerik:RadComboBox ID="ddlCountry" ExpandDirection="Down" runat="server"
                              MaxHeight="300px" Width="120px" DropDownWidth="150px"
                              AllowCustomText="false"   MarkFirstMatch="true" >
  </telerik:RadComboBox >
But when i start typing in that Rad Combobox,it works fine until i type the second character of country but when i typed the third character the existing values are getting erased and only the third character which i typed comes to first position and its MarkFirstMatch property is not working properly.

first i can try to bind  the rad combobox using code behind methods  with different  countries name and then  i also try to bind it with  the hard coded items values with different  countries name using ID="ddlCountry" .( Which Gives me Same Results)

But this problem is resoved when i simply changed the ID of rad combobox e.g
 <telerik:RadComboBox ID="ddlCountries" ExpandDirection="Down" runat="server"
                              MaxHeight="300px" Width="120px" DropDownWidth="150px"
                              AllowCustomText="false"   MarkFirstMatch="true" >
  </telerik:RadComboBox >
and its MarkFirstMatch property works fine...and it is happening for some specific keywords like ddlCountry, ddlState etc.
I am not sure what's the exact reason behind it??? My current telerik radcontrols version is 2011.1.1.519.35

Please Help.
Shubham
Top achievements
Rank 1
 answered on 30 Jan 2019
3 answers
118 views
Is there a way to force a file download instead of opening PDF/HTML in the browser with the built in MasterTableView.ExportToXXXX() function?
Marin Bratanov
Telerik team
 answered on 30 Jan 2019
4 answers
575 views

Hi, I am using RadUpload control of telerik. I have added Rad upload on page and one asp Text box. what I want to do is OnClientFileSelected event selected file path get added in asp Text box at client side. I did tried following ways but i got only file name i.e. test.text or test.doc. I do want to add entire path in asp text box like "C:\folder1\folder2\test1.txt". How should i do this.

function fileSelected(radUpload, eventArgs)
 
{
   
var input = eventArgs.get_fileInputField().value;
   document
.getElementById("<%= txtPath.ClientID %>").value=input;
 
}

Thanks In Advance

Rumen
Telerik team
 answered on 30 Jan 2019
1 answer
43 views
I'm using J Query to detect the if an <EM> tag is found in a specific field and only showing it if the EM tag is in the field. The problem is it I've applied the script on the keypress event, and the applying of the <Em> tags seems to happen after the keypress event. What client event happens after after the applying of av<Em> tags, that I can apply my script?
William
Top achievements
Rank 1
 answered on 29 Jan 2019
4 answers
497 views

I put an Ajax panel on my page but now downloads do not work, I know is cause of the response.write stream.  I s there a way to get around this in the code behind of the itemCommand.  The downloads are in a sub grid of my main grid so I cannot take it out of the ajax panel.

 

<DetailTables>
                               <telerik:GridTableView DataKeyNames="intUploadId" Name="SubGrid" Width="50%" TableLayout="Fixed" Font-Size="10" AutoGenerateColumns="False" SkinID="Web20">
                                       <ParentTableRelation>
                                           <telerik:GridRelationFields DetailKeyField="intWarrantyNumId" MasterKeyField="intWarrantyNumId" />
                                       </ParentTableRelation>
                                       <HeaderStyle Font-Bold="true" HorizontalAlign="Center" />
                                       <ItemStyle HorizontalAlign="Center"  />
                                       <AlternatingItemStyle HorizontalAlign="Center" />
                                       <Columns>
                                            <telerik:GridTemplateColumn HeaderText="File">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="lnkDelete" runat="server" CommandArgument='<%# Bind("intUploadId")%>' CommandName="DeleteDoc" OnClientClick="return confirm('Are you sure you want to delete this attachment');">
                                                        <asp:Image ID="imgDelete" runat="server" ImageUrl="~/Images/Delete Circle Small.png" BorderStyle="None" />
                                                    </asp:LinkButton>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>  
                                            <telerik:GridTemplateColumn HeaderText="File">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="lnkFile" runat="server" Text='<%# Bind("strLocation")%>' CommandArgument='<%# Bind("strLocation")%>' CommandName="Download"></asp:LinkButton>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>  
                                       </Columns>
                               </telerik:GridTableView>
                           </DetailTables>
 
 If (e.CommandName = "Download") Then
           Dim filename As String = e.CommandArgument.ToString
           'Dim path As String = Server.MapPath("~/RMAUploads/" & filename)
           Dim targetfolder As String = "\\" & ServerName & "\iPBR\Warranty\" & filename
           Response.AddHeader("Content-disposition", "attachment; filename=" & filename)
           Response.ContentType = "application/octet-stream"
           Response.WriteFile(targetfolder)
           Response.End()
       End If

jajanes
Top achievements
Rank 1
 answered on 29 Jan 2019
1 answer
107 views

Hello,

I have found a weird problem with detail tables.  After assigning the correct datakeys to the tables I found that one of my detail tables was not working even though there was nothing wrong with the query nor the detail table structure.

After a bunch of trial and error I found that unless the datakey names are the same in the Master and Detail grids, detail grids will not query any data.

In my mind this is a bug as we can assign whatever datakey names we want in the DataKeys attribute.  The grid should not be enforcing a foreign key naming constraint, while a lot of the time these will be the same some times they will not and in those cases the master/detail relationship within the RadGrid breaks and does not work properly.

Full disclosure, our Telerik version is so old no one knows what version it is and we don't have access to the source files anymore to find out.  It is a good bet it is pre-2013.

Attila Antal
Telerik team
 answered on 29 Jan 2019
1 answer
130 views

Hi,

Dont you feel load on demand feature should also be there ? If it is already there I have not found any mention of it any where. Can I get some clue on it ?

 

Thanks

 

Milind Shevade

Peter Milchev
Telerik team
 answered on 29 Jan 2019
3 answers
243 views

Can a radiobuttonlist trigger a call to ItemCommand inside a RadGrid.  Below, the button works, but the radiobuttonlist does not hit the event in code behind.

<telerik:GridTemplateColumn AllowFiltering="false" HeaderText="Approvals" UniqueName="Approvals">
    ItemStyle HorizontalAlign="Left" Width="140" />
    <HeaderStyle HorizontalAlign="Left" Width="140" />
    <HeaderTemplate>
    </HeaderTemplate>
    <ItemTemplate>
        <asp:RadioButtonList ID="rdoApprovals" runat="server" RepeatDirection="Horizontal"
                    CommandName="ApproveDeny">
                    <asp:ListItem Value="1">Approve</asp:ListItem>
                    <asp:ListItem Value="2">Deny</asp:ListItem>
            </asp:RadioButtonList>
        <asp:Button ID="btnTest" runat="server" Text="test" CommandName="test" />
    </ItemTemplate>
</telerik:GridTemplateColumn>
Eyup
Telerik team
 answered on 29 Jan 2019
6 answers
228 views
A root node is interpreted by RadTreeView as any node with a DataFieldParentID of null or empty default value.

I have a hierarchy which is cut from a larger hierarchy and as a result, the Parent value (a Guid in this case) of the nodes I want to root are set to specific values.  As I am binding to an ObjectDataSource I simply overwrite the Parent Guid for the root nodes in my BL with Guid.Empty.

However it would be nice if there were some way to specify the root value to hook on to so this fudge would not be necessary.

One alternative I tried was to create a static node with a value of the specific root Guid I want to hook on to.  However I found that even with AppendDataBoundItems enabled the bound data does not hook on to the single, static, root node.

Has anyone else shared my experience?

Thanks
Neal
Top achievements
Rank 1
 answered on 29 Jan 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?