Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
190 views
Hello,

I have a RadGrid + Asp:Panel. What I want to accomplish is this:
1. On grid rowclick -> refresh update panel, don't refresh grid (this is important because grid has many rows)
2. On grid PageIndexChanged: only refresh grid, don't refresh update panel.

I started with:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"
        <telerik:AjaxSetting AjaxControlID="GridList" EventName="ItemCommand"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="PanelPreview" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
Now the rowclick works perfectly: the Panel is updated on rowclick and grid isn't. Only problem is that paging doesn't work, so I added an AjaxSetting for PageIndexChanged:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="GridList" EventName="ItemCommand"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="PanelPreview" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
        <telerik:AjaxSetting AjaxControlID="GridList" EventName="PageIndexChanged"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="GridList" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
Now the paging works, but on row click it updates the grid as well...
Anybody knows what's going on and how I can fix this?

Thanks in advance!



Iana Tsolova
Telerik team
 answered on 03 Feb 2009
1 answer
170 views

Hi,
I'm using RadControls for ASPNET AJAX Q2 2008 (Telerik.Web.UI.dll assembly version  2008.2.1001.20)

My problem is related to the horizontal scroll bar in the grid when I use FrozenColumnsCount > 0.

If you click in the middle of the bar (not of the slider) it flashes and the slider doesn't move
If you click and maintain clicked in the middle of the bar (not of the slider) it change color and the slider moves very slow 
If you click on the right arrow the slider moves  but only after I have clicked a lot of times.

You can check these behaviors on your test demo example:
http://demos.telerik.com/aspnet/Grid/Examples/GeneralFeatures/FrozenColumns/DefaultCS.aspx

Can you check and fix these problems?

Regards

Nikolay Rusev
Telerik team
 answered on 03 Feb 2009
3 answers
148 views
I have configured a toolbar to use a custom skin, but I notice when inspecting the source that some of the embedded skin information is still retained.  Specifically, when I create a drop-down button, the wrapper DIV on the drop-down menu is assigned both my custom class and the default class, as follows:

<div class="RadToolBarDropDown RadToolBarDropDown_InTouch" ...

Similarly, the WebResource.axd file is outputting CSS information for the RadToolBarDropDown class which is overriding the CSS properties I specify in my custom skin.

How can I get the embedded skins to REALLY be removed?

Josh
Atanas Korchev
Telerik team
 answered on 03 Feb 2009
2 answers
146 views
Hi,

I have a simple grid with only one button to delete a row.
I try all example that a found (demo, forum, etc...) but it's the same.
The row is well deleted from the database but the grid is not update .
The method RadGrid1_NeedDataSource is well called after the delete method and the ViewState is well changed!
If i reload completely the page i see off course the change.

Please help;-)

Grid code :

            <asp:Panel ID="PanelOverviewPollAdvice" runat="server" SkinID="PageContent"
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
                    <AjaxSettings> 
                        <telerik:AjaxSetting AjaxControlID="RadGrid1"
                            <UpdatedControls> 
                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/> 
                            </UpdatedControls> 
                        </telerik:AjaxSetting> 
                    </AjaxSettings> 
                </telerik:RadAjaxManager> 
                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="25"><img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" /></telerik:RadAjaxLoadingPanel> 
                <br /> 
                 
                <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Vista" 
                     GridLines="None"  
                     AllowPaging="True"  
                     AllowSorting="True"  
                     Width="100%"  
                     AutoGenerateColumns="False" 
                     OnNeedDataSource="RadGrid1_NeedDataSource"  
                     AllowFilteringByColumn="true"  
                     PageSize="20" OnInit="RadGrid1_Init"  
                     OnItemCreated="RadGrid1_ItemCreated"  
                     OnDeleteCommand="RadGrid1_DeleteCommand" 
                     AllowAutomaticDeletes="true"
                     <PagerStyle AlwaysVisible="True" Mode="Slider" /> 
                     <MasterTableView  
                        GridLines="None"  
                        Width="100%"  
                        DataKeyNames="PollAdvisId"  
                        IsFilterItemExpanded="true"  
                        AllowFilteringByColumn="true"
                       <RowIndicatorColumn><HeaderStyle Width="22px" /> 
                       </RowIndicatorColumn> 
                       <ExpandCollapseColumn><HeaderStyle Width="22px" /> 
                       </ExpandCollapseColumn> 
                       <Columns> 
                           <telerik:GridBoundColumn AllowFiltering="false" UniqueName="PollAdvisId" HeaderText="ID" DataField="PollAdvisId"  ItemStyle-HorizontalAlign="Left"
                               <HeaderStyle Width="30px" HorizontalAlign="Left" /> 
                           </telerik:GridBoundColumn> 
                           <telerik:GridBoundColumn UniqueName="Email" HeaderText="E-mail" DataField="Email" ItemStyle-HorizontalAlign="Left"
                               <HeaderStyle HorizontalAlign="Left" /> 
                               <ItemStyle HorizontalAlign="Left" /> 
                           </telerik:GridBoundColumn> 
                           <telerik:GridBoundColumn UniqueName="Advis" HeaderText="Advies" DataField="Advis" ItemStyle-HorizontalAlign="Left"
                               <HeaderStyle HorizontalAlign="Left" /> 
                               <ItemStyle HorizontalAlign="Left" /> 
                           </telerik:GridBoundColumn> 
                           <telerik:GridDateTimeColumn UniqueName="LastUpdate" HeaderText="Datum" DataField="LastUpdate" ItemStyle-HorizontalAlign="Left" DataType="System.DateTime" DataFormatString="{0:dd MM yyyy}"
                                 <HeaderStyle HorizontalAlign="Left" /> 
                               <ItemStyle HorizontalAlign="Left" /> 
                           </telerik:GridDateTimeColumn>                      
                           <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete"  
                               CommandName="Delete" ButtonType="ImageButton"  
                               ConfirmText="Do you want to delete this Pool advies?"  
                               ConfirmDialogType="RadWindow" ConfirmTitle="Delete"   
                               ItemStyle-HorizontalAlign="Left" Visible="true" HeaderText="Wissen"
                               <ItemStyle HorizontalAlign="Left" /> 
                           </telerik:GridButtonColumn> 
                       </Columns> 
                      
                       </MasterTableView><FilterMenu EnableTheming="True" Skin="Vista"><CollapseAnimation Duration="200" Type="OutQuint" /></FilterMenu></telerik:RadGrid> 
                        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista"></telerik:RadWindowManager> 
            </asp:Panel> 



Here is my C# code. I don't work with DataTable!

/// <summary> 
        ///  
        /// </summary> 
        private void LoadGrid() 
        { 
            var pollAdvice = new Business.PollAdvis(); 
            List<Business.PollAdvis> _list = pollAdvice.SelectAll(); 
            ViewState["PollAdviceList"] = _list; 
            RadGrid1.DataSource = _list; 
            RadGrid1.MasterTableView.DataKeyNames = new[] { "PollAdvisId" }; 
 
            RadGrid1.DataBind(); 
        } 
 
 
 
/// <summary> 
        /// Delete an pollAdvice 
        /// </summary> 
        /// <param name="sender">object</param> 
        /// <param name="e">GridItemEventArgs</param> 
        protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e) 
        { 
            var item = (GridDataItem)e.Item; 
            string pollAdviceIdStr = item.OwnerTableView.DataKeyValues[item.ItemIndex]["PollAdvisId"].ToString(); 
            int _pollAdviceId = int.Parse(pollAdviceIdStr); 
            var _pollAdvice = new Business.PollAdvis(_pollAdviceId); 
            if (ViewState["PollAdviceList"] != null
            { 
                var _list = (List<Business.PollAdvis>) ViewState["PollAdviceList"]; 
                _list.Remove(_pollAdvice); 
                ViewState["PollAdviceList"] = _list; 
            } 
            _pollAdvice.Delete(_pollAdviceId); 
        } 
 
 
/// <summary> 
        ///  
        /// </summary> 
        /// <param name="source">object</param> 
        /// <param name="ex">GridNeedDataSourceEventArgs</param> 
        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs ex) 
        { 
            if (ViewState["PollAdviceList"] != null
            { 
                var _list = (List<Business.PollAdvis>)ViewState["PollAdviceList"]; 
                RadGrid1.DataSource = _list; 
            } 
        } 
 
 
Yves
Top achievements
Rank 1
 answered on 03 Feb 2009
1 answer
115 views
I am working on ASP.NET 3.5.I am using 5 or 6 Ajax Panels on the homepage as well as some other Rad Controls.The problems is : these controls required too much javascript http calls in begining which slows up the application quite badly.When I tested the page through fiddler , it shows that there are 6 javascript http calls comprising 160KBs.When I replaced the ScriptManager with RadScriptManager , it considerably reduced http calls and size to 130KB by combining and compressing those calls into a single http call. ----- Is there a way that I can further reduce the size of Javascript call or at least load them at the end of page so that my Page is visible to users and Javascript is downloading side by side. At the same time if a user tries to use any java functionality it'll warn them that it is laoding right now.

Thanks
Iana Tsolova
Telerik team
 answered on 03 Feb 2009
1 answer
268 views
Hello Telerik Community,
I am working with the radTreeview with a radtreeview context menu.  I need to open a modal popup via javascript from one of the menu items. 
Could you please explain how to go about this.
Thanks in advance.
~Julie
Shinu
Top achievements
Rank 2
 answered on 03 Feb 2009
1 answer
66 views
Couldn't find a post about this...

the upload managers -- file manager and document manager -- don't work in internet explorer 8.
I just updated to rc 1, but it didn't work in beta 2 either.

You can verify by going to http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx and click on image or document manager. There is nothing there. There should be icons, folder, and the possibility to upload.


Regards,
Fredrik Josefsson
Mallverkstan
Rumen
Telerik team
 answered on 03 Feb 2009
1 answer
137 views
Hello:

I've been scratching my head for two days for trying to migrating to the new ajax version of radtreeview.
I have read your tutorials and have tried almost everything mentioned from registering the telerik assembly to creating a radtree with radajaxmanager. The sample program compiles correctly but when I tried to access a tree using javascript (within radcodeblock) using:
var treeView = $find("RadTreeView2");
...
...
<telerik:RadTreeNode runat="server" Text="Products" ExpandMode="ClientSide">
               <Nodes>
                   <telerik:RadTreeNode runat="server" Text="Books" ExpandMode="ClientSide">
                   <Nodes>
                       <telerik:RadTreeNode runat="server" Text="Fiction"></telerik:RadTreeNode>
                       <telerik:RadTreeNode runat="server" Text="Non-Fiction"></telerik:RadTreeNode>
                       <telerik:RadTreeNode runat="server" Text="Biography"></telerik:RadTreeNode>
                       <telerik:RadTreeNode runat="server" Text="Humor"></telerik:RadTreeNode>
                   </Nodes>
                   </telerik:RadTreeNode>
               </Nodes>
           </telerik:RadTreeNode>
           </Nodes>
       </telerik:RadTreeView>
...



After debugging, it shows that the find did nothing and treeView is null.
Is there any explaination to this?
Shinu
Top achievements
Rank 2
 answered on 03 Feb 2009
3 answers
130 views
When i went to : http://demos.telerik.com/ASPNET/Prometheus/Calendar/Examples/Functionality/Globalization/DefaultCS.aspx

In the Select culture:
  • Select Thai (Thailand)
  • The Calendar Change to Thai format..
  • Click on Month in the Calendar to select other month

Result: "Shown all the Thai month but Show the Year In English format "2000,2001,2002""
Expected Result: "Show all the Thai month and also Year in Thai format 2543,2544,2545"

  • Click on cancel button
  • Click on > button to move to next month
Result: "Shown next month the month name is Thai but the Year is English Format 2008"
Expected Result: "Shown next month the month name is Thai and the Year in Thai format 2551"

This Problem happen with the Date Picker as well.

What i have to do for this problem?






Pavel
Telerik team
 answered on 03 Feb 2009
4 answers
122 views
I have a master/detail RadGrid. I open the form to insert new record to Master table, then open the form to edit a record in Detail table. When I click Cancel on the form to create new, I have an HttpExpcetion "TelerikDemo.User does not contain a property with the name Address". Are there somethings I miss? Thank you.

Here is my markup:

<telerik:RadGrid ID="rgUsers" runat="server" GridLines="None"  
                AutoGenerateColumns="False" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"  
                oneditcommand="rgUsers_EditCommand" 
                onneeddatasource="rgUsers_NeedDataSource"  
                ondetailtabledatabind="rgUsers_DetailTableDataBind"  
                OnUpdateCommand="rgUsers_UpdateCommand" 
                OnInsertCommand="rgUsers_InsertCommand"  
                ondeletecommand="rgUsers_DeleteCommand"
                <HeaderContextMenu EnableTheming="True"
                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                </HeaderContextMenu> 
 
                <MasterTableView Name="Users" CommandItemDisplay="Top" DataKeyNames="Id"
                    <DetailTables> 
                        <telerik:GridTableView Name="Contacts" AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="Id"
                            <EditFormSettings EditFormType="Template"
                                <FormTemplate>                                     
                                    &nbsp;Address: 
                                    <asp:TextBox ID="txtAddress" runat="server" Text='<%# Bind("Address") %>' /> 
                                    <br /> 
                                    &nbsp;City: 
                                    <asp:TextBox ID="txtCity" runat="server" Text='<%# Bind("City") %>' /> 
                                    <br /> 
                                    &nbsp;Zip 
                                    <asp:TextBox ID="txtZip" runat="server" Text='<%# Bind("Zip") %>' /> 
                                    <br /> 
                                    &nbsp;<asp:LinkButton ID="btnUpdate" runat="server" CommandName="Update" Visible='<%# Eval("Id").ToString().Length != 0  %>'>Update</asp:LinkButton> 
                                    <asp:LinkButton ID="btnAdd" runat="server" CommandName="PerformInsert" Visible='<%# Eval("Id").ToString().Length == 0  %>'>Add</asp:LinkButton> 
                                    &nbsp;&nbsp;&nbsp; 
                                    <asp:LinkButton ID="btnCancel" runat="server" CommandName="Cancel">Cancel</asp:LinkButton> 
                                </FormTemplate> 
                            </EditFormSettings> 
                             
                            <Columns> 
                                <telerik:GridBoundColumn DataField="Address" HeaderText="Address" SortExpression="Address" UniqueName="Address"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="City" HeaderText="City" SortExpression="City" UniqueName="City"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="Zip" HeaderText="Zip" SortExpression="Zip" UniqueName="Zip"
                                </telerik:GridBoundColumn> 
                            </Columns> 
                             
                            <CommandItemTemplate> 
                                <asp:LinkButton ID="btnInitInsert" runat="server" CommandName="InitInsert"
                                    Add new Contact 
                                </asp:LinkButton> 
                                <asp:LinkButton ID="btnRefresh" runat="server" CommandName="RebindGrid"
                                    Refresh contact list 
                                </asp:LinkButton> 
                            </CommandItemTemplate> 
                        </telerik:GridTableView> 
                    </DetailTables> 
                 
                    <EditFormSettings EditFormType="Template"
                        <FormTemplate> 
                            &nbsp;First name: 
                            <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox> 
                            <br /> 
                            &nbsp;Last name: 
                            <asp:TextBox ID="txtLastName" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox> 
                            <br /> 
                            &nbsp;<asp:LinkButton ID="btnUpdate" runat="server" CommandName="Update" Visible='<%# Eval("Id").ToString().Length != 0  %>'>Update</asp:LinkButton> 
                            <asp:LinkButton ID="btnAdd" runat="server" CommandName="PerformInsert" Visible='<%# Eval("Id").ToString().Length == 0 %>'>Add</asp:LinkButton> 
                            &nbsp;&nbsp;&nbsp; 
                            <asp:LinkButton ID="btnCancel" runat="server" CommandName="Cancel">Cancel</asp:LinkButton> 
                        </FormTemplate> 
                    </EditFormSettings> 
                     
                    <CommandItemTemplate> 
                        <asp:LinkButton ID="btnInitInsert" runat="server" CommandName="InitInsert" Visible='<%# !rgUsers.MasterTableView.IsItemInserted %>'
                            Add new Customer 
                        </asp:LinkButton> 
                        <asp:LinkButton ID="btnRefresh" runat="server" CommandName="RebindGrid"
                            Refresh customer list 
                        </asp:LinkButton> 
                    </CommandItemTemplate> 
 
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </RowIndicatorColumn> 
 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </ExpandCollapseColumn> 
                     
                    <Columns> 
                        <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" UniqueName="FirstName"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" SortExpression="LastName" UniqueName="LastName"
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </MasterTableView> 
 
                <FilterMenu EnableTheming="True"
                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                </FilterMenu> 
            </telerik:RadGrid>         

Here is my C# code:

protected void Page_Load(object sender, EventArgs e) 
        { 
        } 
 
        protected void rgUsers_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
        { 
            rgUsers.DataSource = TelerikDemo.User.GetAll(); 
        } 
 
        protected void rgUsers_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) 
        { 
            GridDataItem parent = e.DetailTableView.ParentItem; 
            int userId = Convert.ToInt32(parent.GetDataKeyValue("Id")); 
            rgUsers.MasterTableView.DetailTables[0].DataSource = Contact.GetAllContactsForUser(userId); 
        } 
 
        protected void rgUsers_EditCommand(object source, GridCommandEventArgs e) 
        { 
            e.Item.Edit = true
        } 
 
        protected void rgUsers_UpdateCommand(object source, GridCommandEventArgs e) 
        { 
            GridEditableItem editedItem = e.Item as GridEditableItem; 
 
            if (e.Item.OwnerTableView.Name.Equals("Users")) // Update user 
            { 
                int userId = Convert.ToInt32(editedItem.GetDataKeyValue("Id")); 
                string firstName = (editedItem.FindControl("txtFirstName"as TextBox).Text; 
                string lastName = (editedItem.FindControl("txtLastName"as TextBox).Text; 
 
                TelerikDemo.User.Update(userId, firstName, lastName); 
            } 
            else if (e.Item.OwnerTableView.Name.Equals("Contacts")) // Update contact 
            { 
                int contactId = Convert.ToInt32(editedItem.GetDataKeyValue("Id")); 
                string address = (editedItem.FindControl("txtAddress"as TextBox).Text; 
                string city = (editedItem.FindControl("txtCity"as TextBox).Text; 
                string zip = (editedItem.FindControl("txtZip"as TextBox).Text; 
 
                Contact.Update(contactId, address, city, zip); 
            } 
        } 
 
        protected void rgUsers_InsertCommand(object source, GridCommandEventArgs e) 
        { 
            GridEditableItem editedItem = e.Item as GridEditableItem; 
 
            if (e.Item.OwnerTableView.Name.Equals("Users")) // Create user 
            { 
                string firstName = (editedItem.FindControl("txtFirstName"as TextBox).Text; 
                string lastName = (editedItem.FindControl("txtLastName"as TextBox).Text; 
 
                TelerikDemo.User.Create(firstName, lastName); 
            } 
            else if (e.Item.OwnerTableView.Name.Equals("Contacts"))  // Create contact 
            { 
                string address = (editedItem.FindControl("txtAddress"as TextBox).Text; 
                string city = (editedItem.FindControl("txtCity"as TextBox).Text; 
                string zip = (editedItem.FindControl("txtZip"as TextBox).Text; 
                GridDataItem parent = e.Item.OwnerTableView.ParentItem; 
                int userId = Convert.ToInt32(parent.GetDataKeyValue("Id")); 
 
                Contact.Create(address, city, zip, userId); 
            } 
        } 
 
        protected void rgUsers_DeleteCommand(object source, GridCommandEventArgs e) 
        { 
            GridEditableItem editedItem = e.Item as GridEditableItem;             
            int id = Convert.ToInt32(editedItem.GetDataKeyValue("Id")); 
 
            if (e.Item.OwnerTableView.Name.Equals("Users")) // Remove user 
            { 
                TelerikDemo.User.Remove(id); 
            } 
            else if (e.Item.OwnerTableView.Name.Equals("Contacts"))  // Remove contact 
            { 
                Contact.Remove(id); 
            } 
        } 

t800t8
Top achievements
Rank 1
 answered on 03 Feb 2009
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?