Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
155 views
Would it be possible to implement <EditFormTemplate> and <InsertFormTemplate> in RadGrid's <EditFormSettings>? Currently I have to have code behind (often done with <% %> tags but still server side code) to set the visibility, text, etc of controls on the <FormTemplate>, it would be so much better if the layout for both versions could be done with no server-side code. Other edit controls (eg RadListView) have separate templates for edit & insert and it works well.

Thanks

ROSCO

PS: I tried to add a feature request in PITS but couldn't seem to get it to work.
Lucania
Top achievements
Rank 1
 answered on 28 Sep 2011
5 answers
306 views
Hi,
I have a collection of about 500 classes I need to display in Telerik RadGrid.
The classes have a parent-child relationships data.
I have configured the grid like in examples for self-reference hierarchy, but when I run the application I get the following error:
Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

The Parent property: GrpParentDeptId
Child property: GrpDeptId

I don't know why is this happening. I have only 500 rows!!!
I also tried setting the 
<system.web.extensions>  
   <scripting>  
       <webServices>  
          <jsonSerialization maxJsonLength="2147483644" />
       </webServices>  
   </scripting>  
</system.web.extensions>
but with no luck.
I am sending you the attachment with the views, code-behind, and the data xml I am pooling the data from.

Please help.
:-(
Nick Smith
Top achievements
Rank 1
 answered on 27 Sep 2011
6 answers
282 views
Hi,

I have a TreeView where all the nodes expand mode is set to ServerSideCallback. When new nodes are added their expand mode is also set to ServerSideCallback.

In my situation I need to expand the selected node based on the result of a partial postback.

On the server side I have a handler for the NodeExpand event.

protected void rtvMain_NodeExpand(object sender, RadTreeNodeEventArgs e)
{
    // Logic/Breakpoint here

}



And I have a javascript function that looks like this:

 function ExpandSelectedNode() {
                 var tree = $find("<%= rtvMain.ClientID %>");

                 if (tree.get_selectedNode() != null) {

                     var selectedNode = tree.get_selectedNode();
                     selectedNode.expand();
                 }
             }


After the ajax/partial postback I call the javascript function by registering a startup script. I use ScriptManager.RegisterStartupScript and call my javascript function "ExpandSelectedNode()"

In the treeview I see the default loading animation appear on the selected node, which would indicated it is performing an asynchronous operation. The problem is that the server side handler "rtvMain_NodeExpand()" never gets called.


However, when I click the [+] next to the treeview item the postback is fired and it calls "rtvMain_NodeExpand()" as it should. This tells me that my treeview and its nodes are configured properly. So I have to assume there is a bug in the RadTreeNode.expand() client side method that is preventing it from firing the server side callback.



Paul
Top achievements
Rank 1
 answered on 27 Sep 2011
5 answers
264 views
Hi,

In my grid i have <telerik:GridNumericColumn..../> columns.When grid goes into edit mode i add onFocus evenet handlers

GVDataGridNumericColumn gc = this.Columns[ColumnCounterIndex] as GVDataGridNumericColumn;
RadNumericTextBox radNumericTextBox = control as RadNumericTextBox;
//add event handler
radNumericTextBox.TextChanged += new EventHandler(RadGridRadNumericTextBox_TextChanged);
//add js event handler
radNumericTextBox.Attributes.Add("OnFocusIn", "StoreMe( radNumericTextBox.ClientID)");

In StoreMe stores ClientID in hidden field and in PageLoad

function pageLoad(sender, args)
{
$find(ClientID).focus();
}

this suppose to set focus in RadNumericTextBox, but somehow it doesn't.
alert($find(ClientID)); returns [object Object].

Please let me know where is the bug/mistake in code.

thanks
virendra
Mike
Top achievements
Rank 1
 answered on 27 Sep 2011
1 answer
82 views
Hi, 
 I encounter a problem that i use template edit form of grid, but in the edit form, the textbox value never be updated, always keep the old value. Can you help me find why this happen?  Please see the bold fonts.

Front code: 
<telerik:RadGrid ID="RadGridQuestionTable" runat="server" AllowFilteringByColumn="false"
                OnItemCommand="RadGridQuestionTable_ItemCommand" CssClass="contenttable" Width="100%"
                AllowPaging="True" AllowSorting="True" PageSize="10" ShowFooter="true" AutoGenerateColumns="False"
                Skin="Office2007" GridLines="None" ShowGroupPanel="False" EnableHeaderContextMenu="False"
                OnNeedDataSource="RadGridQuestionTable_NeedDataSource" >
                <ClientSettings AllowColumnHide="False" AllowColumnsReorder="True" AllowDragToGroup="False">
                </ClientSettings>
                <MasterTableView EnableViewState="false" DataKeyNames="ID" EditMode="PopUp">
                    <Columns>
                        <telerik:GridBoundColumn DataField="SectionID" HeaderText="" UniqueName="SectionID"
                            ItemStyle-Width="20px" Display="false">
                            <ItemStyle Width="20px"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Title" HeaderText="Question" UniqueName="Question"
                            ItemStyle-Width="200px">
                            <ItemStyle Width="200px"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridButtonColumn Text="<img src='../Resource/images/edit.gif' border=0>"
                            CommandName="Edit" ButtonType="LinkButton" UniqueName="myEditColumn">
                            <ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
                        </telerik:GridButtonColumn>
                        <telerik:GridButtonColumn Text="<img src='../Resource/images/delete.gif' border=0>"
                            ConfirmText="Are you sure to delete this Question?" UniqueName="columnDelete"
                            CommandName="Delete" ButtonType="LinkButton" HeaderText="" ItemStyle-HorizontalAlign="center">
                            <ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
                        </telerik:GridButtonColumn>
                    </Columns>
                    <EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit Question: {0}"  
                        CaptionDataField="Title" EditFormType="Template">
                        <FormTemplate>
                            <table id="Table1" cellspacing="1" cellpadding="1" width="250" border="0">
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Name:
                                    </td>
                                    <td>
                                        <telerik:RadTextBox ID="EditTitleTxt" runat="server" 
                                            Text='<%# Bind( "Title") %>' 
                                            Skin="Office2007">
                                        </telerik:RadTextBox>

                                    </td>
                                </tr>
                            </table>
                            <table style="width: 100%">
                                <tr>
                                    <td align="right">
                                        <asp:Button ID="Button1" Text="Update"
                                            runat="server"  CommandName="Update">
                                        </asp:Button>&nbsp;
                                        <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                                        </asp:Button>
                                    </td>
                                </tr>
                            </table>
                        </FormTemplate>
                    </EditFormSettings>
                </MasterTableView>
                <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Office2007">
                </HeaderContextMenu>
            </telerik:RadGrid>


Back-end Code: 

protected void RadGridQuestionTable_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                int id = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"].ToString());
                try
                {
                    PPHGAuditQuestion questionObj = questionRespository.FindSingle((PPHGAuditQuestion s) => s.ID == id);
                    questionRespository.Delete(questionObj);
                    questionRespository.SaveChanges();
                    RadGridQuestionTable.DataSource = BindGrid(TemplateRadTreeView.SelectedNode == null ? 0 : int.Parse(TemplateRadTreeView.SelectedNode.Value));
                    RadGridQuestionTable.DataBind();
                }
                catch
                {
                    questionRespository.ClearChanges();
                }
            }
            else if (e.CommandName == "Update")
            {
                GridEditableItem editedItem = e.Item as GridEditableItem;
                string title = (editedItem.FindControl("EditTitleTxt") as RadTextBox).Text;   // I also debug to here, the value always keep the old value.
                int id = int.Parse(e.CommandArgument.ToString());
                try
                {
                    PPHGAuditQuestion questionObj = questionRespository.FindSingle((PPHGAuditQuestion s) => s.ID == id);
                    questionObj.Title = title;
                    questionObj.ModifiedBy = "";
                    questionObj.DateModified = DateTime.Now;
                    questionRespository.UpdateOrCreate(questionObj);
                    questionRespository.SaveChanges();
                    RadGridQuestionTable.DataSource = BindGrid(TemplateRadTreeView.SelectedNode == null ? 0 : int.Parse(TemplateRadTreeView.SelectedNode.Value));
                    RadGridQuestionTable.DataBind();
                }
                catch
                {
                    questionRespository.ClearChanges();
                }
            }
        }
Jayesh Goyani
Top achievements
Rank 2
 answered on 27 Sep 2011
3 answers
101 views
i have a radGrid with ColumnFilters that allows paging as well. we've been doing exports to excel from an external button that's simply been running the same thing as the need datasource. however, the only thing i cannot figure out how to do is "capture" any column filtering. it seems like i have to use an external radFilter apart from the grid to do this. is there a way to get what someone has filtered to on the column? most of our grids use the external radFilter & this export works just fine, i can tap into those filters. just can't figure out if it's possible to do the same with the column filters. thanks for any help on this.
rik
rik butcher
Top achievements
Rank 1
 answered on 27 Sep 2011
2 answers
188 views
I have a radgrid using master detail hierarchy and I want to be able to disable the edit and insert commands depending on the user. Where is the best place/event to disable these commands? I am able to prevent the Insert command from being visible but can't find where to hide the Edit.
Protected Sub RadGrid1_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
        If (TypeOf e.Item Is GridCommandItem) Then
            Dim commandItem As GridCommandItem = CType(e.Item, GridCommandItem)
            commandItem.Visible = False
        End If
    End Sub

AkAlan
Top achievements
Rank 2
 answered on 27 Sep 2011
2 answers
366 views
I have a textbox control (textbox1) within the itemtemplate of a radgrid and this radgrid lies within a contentplaceholder of a master page.

How can I use findcontrol to find this textbox1 inside the page_load event ?

Thank you
vincent
Top achievements
Rank 1
 answered on 27 Sep 2011
6 answers
189 views
I found related posts on this, but I didn't find anything specific to what I'm looking for. I like to move the Y-Axis item labels to the right of the Y-Axis. Is that possible? Thanks for any pointers on this.
George
Top achievements
Rank 1
 answered on 27 Sep 2011
1 answer
221 views
Hi to  All,
               This is siddiqali Working on Sharepoint 2010 Using Visual webpart.I am using Rad Controls .,I need to upload image in Sharepoint 2010 Picture Library using Visual Web-part .Can any one tell me how it is possible.

Thanks,
MOHAMMAD SIDDIQALI.




Kalina
Telerik team
 answered on 27 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?