Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
107 views
Hi am able to select value on server side but I am not able to add the same selected node text on client are. My code is mention below.
RadTreeNode node = rdTreeView.FindNodeByValue(nodeValue);
if (node != null)
{
    node.Checked = true;
}

Means When we select node using "OnClientEntryAdded" then node is checked and text belong to node will available to client area. But the same is not working when we do it programmatically
Boyan Dimitrov
Telerik team
 answered on 02 Oct 2014
7 answers
402 views
Hi,

Can you help me with the following.

I'am using the RadGrid inside the RadComboBox itemtemplate and I have problems with setting the combobox selected text/value on grid's OnRowSelected client side event. When I select a row from grid after the page has been loaded then the combobox selected text will be every grid row's values concatenated but when I select a new row after that then the selected text will be displayed correctly. Can you tell me why this happens?

I also want to access the combobox selected text/value on server side after postback. I added trackChanges() and commitChanges() methods like below but still the combo.ClientChanges count property is 0 e.g. after asp:button click.

Grid is grouped by two columns, so is it possible to configure combobox so that if user clicks the category row then combobox should not be closed?


<rad:RadCodeBlock ID="codeBlock" runat="server">  
    <script type="text/javascript">  
 
        function onRowSelected(sender, args)   
        {  
            var selectedText = args.getDataKeyValue("TypeName");  
            var selectedValue = args.getDataKeyValue("ID");  
 
            var combo = $find("rcb");  
 
            if (selectedValue.length > 0)   
            {  
                combo.trackChanges();  
                combo.set_text(selectedText);  
                combo.set_value(selectedValue);  
                combo.commitChanges();  
                combo.hideDropDown();  
            }  
        }  
          
    </script> 
</rad:RadCodeBlock> 
 
<rad:RadComboBox ID="rcb" runat="server" Width="400px">  
    <Items> 
        <rad:RadComboBoxItem Selected="true" /> 
    </Items> 
    <ItemTemplate> 
        <rad:RadGrid    ID="rgRiskClasses"   
                        runat="server"   
                        Skin="Web20" 
                        OnItemCommand="rgRiskClasses_ItemCommand">  
 
            <MasterTableView    AutoGenerateColumns="false"   
                                GroupLoadMode="Client"   
                                GroupsDefaultExpanded="true" 
                                ClientDataKeyNames="ID,TypeName">  
                <Columns> 
                    <rad:GridBoundColumn DataField="id"></rad:GridBoundColumn> 
                    <rad:GridBoundColumn DataField="TypeName"></rad:GridBoundColumn> 
                </Columns> 
                  
                <GroupByExpressions> 
                    <rad:GridGroupByExpression> 
                        <GroupByFields> 
                            <rad:GridGroupByField FieldName="CategoryName" /> 
                        </GroupByFields> 
                        <SelectFields> 
                            <rad:GridGroupByField FieldName="CategoryName" /> 
                        </SelectFields> 
                    </rad:GridGroupByExpression> 
                    <rad:GridGroupByExpression> 
                        <GroupByFields> 
                            <rad:GridGroupByField FieldName="ClassName" /> 
                        </GroupByFields> 
                        <SelectFields> 
                            <rad:GridGroupByField FieldName="ClassName" /> 
                        </SelectFields> 
                    </rad:GridGroupByExpression> 
                </GroupByExpressions> 
            </MasterTableView> 
            <ClientSettings AllowGroupExpandCollapse="false">  
                <Selecting AllowRowSelect="True" /> 
                <ClientEvents OnRowSelected="onRowSelected" /> 
            </ClientSettings> 
        </rad:RadGrid> 
    </ItemTemplate> 
 
</rad:RadComboBox> 

Thanks,
Pete
Hristo Valyavicharski
Telerik team
 answered on 02 Oct 2014
1 answer
123 views
Frankly I'm asking this one only because I'm curious.  

I have a fairly conventional RadGrid set up with edit links on each row.  Each link calls a JavaScript function which in turn causes an editing screen popup.  

The link elements look like this:  
<a id="ctl00_MainContent_RadGrid1_ctl00_ctl04_EditLink" href="#" onclick="return EditForm('14001','0');">Edit</a>

I also have a span at the top of the page that displays "Welcome" logged in person.  Somehow someone messed up the users table and the name field included characters within double quotes.  As such, for example, the field would be rendered like this:
  <span id="lblFullName" style="color:Blue;">Welcome Joe "***" Smith</span>

When this happened, the JavaScript function started crashing. The function got the correct parameters but this line started crashing.
 var oWnd = window.radopen("EditForm.aspx?Id=" + Id, "Edit Item " + Id); 

When I put a catch in there, the error was Cannot read property 'open' of undefined.

Naturally the practical solution to this problem was to purge the database of bad data but I'd still like to know what happened.

 
Kostadin
Telerik team
 answered on 02 Oct 2014
1 answer
84 views
When I use the advanced form (adapted from the demo on this site) to add extra fields to the admin form I have a problem.  With this in place I find that if I try and access a RadWindow on the form load it only works on rare occasions.

When I remove the <telerik:RadScriptReference Path="AdvancedForm.js" /> line from the script manager the radwindow works - although obviously the advanced form functionality then fails.

Any suggestions on what maybe happening here.  My code for finding the radwindow is shown below 

var oWnd = $find("<%=uxFilterRadWindow.ClientId %>");
oWnd.show();

Regards

Jon
Jon
Top achievements
Rank 1
 answered on 02 Oct 2014
1 answer
109 views
we are using rad grid in one of our project. I have a small issue. In the rad grid  . I use jquery to select and deselect all check boxes in Rad Grid. This works fine. My problem is with paging. I am using default paging behaviour of RadGrid. The problem is that on when i select page index 2 or any other index then  select and deselect all check boxes in Rad Grid.  is not working     i want to do this  through jquery  or javascript    i do want use code behind like toggle 

Pavlina
Telerik team
 answered on 02 Oct 2014
1 answer
184 views
Hello, 
I am trying to preload the full images retrieved from a database and bound to the ImageGallery control to cache the images in the browswer and help improve our user experience using javascript. 

I have tried access the image url by getting the RadImageGalleryItems collection and then call get_imageUrl for each item in the array on the OnImageGalleryCreated client-side event.  I can see that there is a ThumbnailUrl associated with each item when I debug in the browser but the ImageUrl is empty.  However, when I click on a Thumbnail image it makes a call to retrieve the full image with a unique imgid which is different than the imgid used for the smaller Thumbnail image. 

Is there a different way to access the full image Url for each Thumbnail?  I've read all the documentation related to the RadImageGallery client-side objects but still can't figure out how to make this work correctly.

thanks,
Min
Antonio Stoilkov
Telerik team
 answered on 02 Oct 2014
1 answer
101 views
hi,
 
i have a RadGrid showing some data and i'm using a formtemplate, a user can edit any item to view it's contents is there any way to print the edited item only ?


thanks
Eyup
Telerik team
 answered on 02 Oct 2014
1 answer
1.8K+ views
I can do this in a normal asp grid but I do not know how to achieve the same with radgrid.

In a asp grid I add nested grids like this:

<asp:TemplateField>
    <ItemTemplate>
        <asp:GridView ID="secondLevelGrid"  runat="server" AutoGenerateColumns="false" CssClass="ChildGrid" OnRowDataBound="secondLevelGrid_OnRowDataBound">
                    <Columns>
 
                        <%--My new nested  grid goes here--%>
 
                        <asp:BoundField DataField="Id" HeaderText="Id" />
                        <asp:BoundField DataField="Code" HeaderText="Code" />
                        <asp:BoundField DataField="Quantity" HeaderText="Q.ty" />
                        </Columns>
            </asp:GridView>
    </ItemTemplate>
</asp:TemplateField>

How do I make the above in a radgrid considering that I have 7 level nested grids?

protected void firstLevelGrid_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        GridView firstLevelGrid = e.Row.NamingContainer as GridView;
        string code = firstLevelGrid.DataKeys[e.Row.RowIndex].Value.ToString();
        GridView secondLevelGridView = e.Row.FindControl("secondLevelGrid") as GridView;
        secondLevelGridView.DataSource = //GetData
        secondLevelGridView.DataBind();
    }
}
How do I make the equivalent of the OnRowDataBound for each nested grid in RadGrid?

Thanks for helping. If someone could please show me how to achieve the above in RadGrid then I will add the additional six level nesting I need. Thanks
Pavlina
Telerik team
 answered on 02 Oct 2014
3 answers
109 views
Hello,
I'm trying to implement the use of a GridBinaryImageColumn + GridBinaryImageColumnEditor to automatically manage the upload of an image into a RadGrid-
Data comes from custom classes, images come from a blob field in db and are rendered properly in grid; however, when I edit the record and try to upload a new image, my  GridBinaryImageColumnEditor always tells it cannot find any uploaded file.

My grid:

<telerik:RadGrid ID="grdLinee" runat="server" AutoGenerateColumns="false" AllowAutomaticUpdates="false" AllowSorting="true" AllowPaging="true" PageSize="10"
                OnNeedDataSource="grdLinee_NeedDataSource" AllowAutomaticInserts="true" AllowAutomaticDeletes="false" OnItemCommand="grdLinee_ItemCommand" OnSelectedIndexChanged="grdLinee_SelectedIndexChanged"
                AllowFilteringByColumn="false" MasterTableView-EditMode="InPlace" ShowHeader="true" ShowFooter="true" ShowStatusBar="true" Skin="Office2007">
                 <PagerStyle Mode="NextPrevAndNumeric" />
                <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true">
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
                <MasterTableView DataKeyNames="idCatalogoLinee" CommandItemDisplay="Top">
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn>
                        <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" ConfirmText="Sei sicuro?" />
                        <telerik:GridBinaryImageColumn DataField="immagine" UniqueName="immagine" ResizeMode="Fit" DataType="System.Byte"></telerik:GridBinaryImageColumn>
//...

Code:

protected void grdLinee_ItemCommand(object sender, GridCommandEventArgs e)
        {
 switch(e.CommandName)
{
   case "Update":
 GridBinaryImageColumnEditor editor = (GridBinaryImageColumnEditor)item.EditManager.GetColumnEditor("immagine");
//editor.RadUploadControl.UploadedFiles.Count here is always 0
//...
}
}


I don't get any error in itemcommand, but always get 0 files   (and editor.UploadedFileContent.Length=0). The same update command is working properly with other database fields, which I can update: what am I missing to properly handle file upload?
Thanks for any hint,
al.

Maria Ilieva
Telerik team
 answered on 02 Oct 2014
3 answers
172 views
I am quite lost with this.
I have a radgrid that has auto generated columns. The user selects an item from a drop down list and the grid load the selected table.
The tables have all the same DB structure: Id-Code-Description-Bla....Bla-Sub.
If the filed "Sub" contains the value "yes" means that the Code has is own table and is not a  single item. So there are rows representing single items and rows  representing another table.

<telerik:RadGrid ID="RadGrid1" runat="server" Culture="it-IT" AllowPaging="True" AllowSorting="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
                <ExportSettings ExportOnlyData="True">
                    <Pdf PageWidth="">
                    </Pdf>
                </ExportSettings>
                <ClientSettings>
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                </ClientSettings>
                <MasterTableView CommandItemDisplay="Top" DataKeyNames="Code" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                    <CommandItemSettings ShowExportToExcelButton="True" />
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton">
                            <HeaderStyle Width="30px" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete" CommandName="Delete" FilterControlAltText="Filter column1 column" ConfirmDialogType="RadWindow" ConfirmText="Do you really want to delete this project and all its content?" UniqueName="Cancel">
                            <HeaderStyle Width="30px" />
                        </telerik:GridButtonColumn>
                    </Columns>
 
                    <EditFormSettings>
                        <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
                    </EditFormSettings>
                    <PagerStyle AlwaysVisible="True" />
                </MasterTableView>
                <PagerStyle AlwaysVisible="True" />
            </telerik:RadGrid>

How can I auto generate the nested grid if the filed value of "Sub" in any row  is "yes"?
Thanks for supporting,
Felice
Pavlina
Telerik team
 answered on 02 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?