Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
165 views
hello,

we are using the RadGrid web version and  i will like to know how to group or ungroup by code the column in a grid. VB.net or c#.

thanks.

Shinu
Top achievements
Rank 2
 answered on 05 Nov 2010
1 answer
89 views
I inserted grid control on my form. The data loads correctly but I cannot update the rows. Here are my code. Can anyone tell me what I did wrong


<

 

td class="style6">

 

 

<telerik:RadGrid ID="RadGrid2" runat="server" DataSourceID="SalesOrderDetails"

 

 

GridLines="None" AllowFilteringByColumn="True" AllowPaging="True"

 

 

AllowSorting="True" AutoGenerateEditColumn="True">

 

 

<MasterTableView AutoGenerateColumns="False" DataSourceID="SalesOrderDetails">

 

 

<CommandItemSettings ExportToPdfText="Export to Pdf" />

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="ItemNo" HeaderText="ItemNo"

 

 

SortExpression="ItemNo" UniqueName="ItemNo">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ItemDesc" HeaderText="ItemDesc"

 

 

SortExpression="ItemDesc" UniqueName="ItemDesc">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Quantity" DataType="System.Int16"

 

 

HeaderText="Quantity" SortExpression="Quantity" UniqueName="Quantity">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PdtLine" HeaderText="PdtLine"

 

 

SortExpression="PdtLine" UniqueName="PdtLine">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CustPrice" DataType="System.Decimal"

 

 

HeaderText="CustPrice" SortExpression="CustPrice" UniqueName="CustPrice">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Currency" HeaderText="Currency"

 

 

SortExpression="Currency" UniqueName="Currency">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Clumpcode" HeaderText="Clumpcode"

 

 

SortExpression="Clumpcode" UniqueName="Clumpcode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="SalesOrder" HeaderText="SalesOrder"

 

 

SortExpression="SalesOrder" UniqueName="SalesOrder">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings>

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

 

<asp:SqlDataSource ID="SalesOrderDetails" runat="server"

 

 

ConnectionString="<%$ ConnectionStrings:Contract-LookupConnectionString %>"

 

 

 

SelectCommand="SELECT ItemNo, ItemDesc, Quantity, PdtLine, CustPrice, Currency, Clumpcode, SalesOrder FROM SalesOrderDetail WHERE (SalesOrder = @SalesOrder)"

 

 

UpdateCommand="UPDATE [SalesOrderDetail] Set [Clumpcode]=? Where [SalesOrder]=?" >

 

 

<SelectParameters>

 

 

<asp:ControlParameter ControlID="MOOGSO" Name="SalesOrder" PropertyName="Text"

 

 

Type="String" />

 

 

</SelectParameters>

 

 

<UpdateParameters>

 

 

<asp:Parameter Name="Clumpcode" Type="String" />

 

 

<asp:Parameter Name="SalesOrder" Type="String" />

 

 

</UpdateParameters>

 

 

</asp:SqlDataSource>

 

 

</td>

 

Princy
Top achievements
Rank 2
 answered on 05 Nov 2010
3 answers
241 views
Hi,

Please help.
I am getting this error:
Sys.WebForms.PageRequestManagerServerErrorException: There was a problem extracting DataKeyValues from the DataSource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the DataSource.

When I update the order item with OrderDetail_UpdateCommand and then gridCustomer.Rebind() and I get the error I mentioned above.   Please help. Thanks.

ASPX:

<telerik:RadGrid ID="gridCustomer" runat="server" OnNeedDataSource="gridCustomer_NeedDataSource" 
OnUpdateCommand="OrderDetail_UpdateCommand" OnDetailTableDataBind="gridOrder_DetailTableDataBind"
   <MasterTableView DataKeyNames="CustomerID" Width="100%" PageSize="20"   ClientDataKeyNames="CustomerID"
      <DetailTables> 
         <telerik:GridTableView DataKeyNames="OrderID" Name="OrderDetail"  EditMode="InPlace"
         <Columns> 
            <telerik:GridBoundColumn 
               DataField="OrderName" 
               HeaderText="Order Name" 
               ReadOnly="true"/> 
            <telerik:GridBoundColumn 
               DataField="DateReceived" 
               HeaderText="Date Received" 
               ReadOnly="true" /> 
            <telerik:GridTemplateColumn 
               HeaderText="Amount to Pay" 
               EditFormColumnIndex="1" 
               HeaderStyle-Width="140px"
               <ItemTemplate> 
                   <asp:Label runat="server" ID="lblAmountToPay" Text='<%# Eval ("AmountToPay", "{0:C}") %>'> </asp:Label>
               </ItemTemplate>
               <EditItemTemplate>
                   <telerik:RadNumericTextBox runat="server" ID="tbxUnitPrice" Width="40px" DbValue='<%# Bind("AmountToPay") %>'
                   </telerik:RadNumericTextBox> 
               </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
           <telerik:GridEditCommandColumn UniqueName="EditOrderPrice" /> 
        </Columns>
    </telerik:GridTableView> 
</DetailTables> 
<Columns> 
    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" /> 
    <telerik:GridBoundColumn DataField="CustomerName" HeaderText="Customer Name"
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn DataField="Address" HeaderText="Address"
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone"
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn DataField="Email" HeaderText="Email"
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Group" HeaderText="Group"
    </telerik:GridBoundColumn> 
  </Columns> 
</MasterTableView> 
<ClientSettings> 
<Selecting AllowRowSelect="True" /> 
<ClientEvents OnRowSelected="GridCustomerRowSelected" /> 
</ClientSettings> 
</telerik:RadGrid>

CODE BEHIND

protected void gridCustomer_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { 
       gridCustomer.DataSource = ClaimProcess.GetCustomer();
}
  
protected void gridOrder_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { 
      switch (e.DetailTableView.Name) 
      {
         case "OrderDetail"
         {
             GridDataItem dataItem = e.DetailTableView.ParentItem; 
             e.DetailTableView.DataSource = ClaimProcess.GetOrder(dataItem.GetDataKeyValue("CustomerID")); 
             break
         }
      }
}
  
protected void OrderDetail_UpdateCommand(object source, GridCommandEventArgs e) 
{
    GridEditableItem item = (GridEditableItem)e.Item; 
    int OrderID = Convert.ToInt32(item.GetDataKeyValue("OrderID")); 
    RadNumericTextBox txtAmountPay = (RadNumericTextBox)e.Item.FindControl("tbxUnitPrice"); 
    UpdateOrder(OrderID, Convert.ToDouble(txtAmountPay.Text));
    gridCustomer.Rebind(); 
}
Tom
Top achievements
Rank 1
 answered on 04 Nov 2010
2 answers
138 views
I have a tooltip that uses a link inside of a raddock.  When I hover on the link, the tooltip comes up, but it gets cut off inside of the raddock.  Scrollbars come up on the raddock, which does not have the appearance I want.  Is there any way to have the tooltip go outside of the raddock, like an higher z-index or something?  I've attached a picture of what it looks like right now ("current tooltip.jpg"), and a picture of what I would like it to look like ("preferred tooltip.jpg").
Richard M
Top achievements
Rank 1
 answered on 04 Nov 2010
1 answer
367 views
I don't know I just feel that I get the weirdest errors.

I have a simple set-up, I have a radgrid with a MasterTableView and a DetailTableView.

In the DetailTableView I have radComboBoxes and the combo boxes are all set to AutoPostback="true" so when the selectedindexchanges the autopostback fires. To minimize the possibilities I even removed the code from the code behind and just kept the Sub, so at the moment it postbacks to an empty Sub.

When it fires I get a javascript error in Sys$WebForms$PageRequestManager$_endPostBack indicating a server error (500).

For testing purposes I put some radComboBoxes on the MasterTableView and put some code for the postback and I do not get a javascript error.

Thanks
Alex
Top achievements
Rank 2
 answered on 04 Nov 2010
4 answers
681 views
Telerik,

We're using the Q2 2010 release and having an unusual, periodic but consistent and reproducible problem with the controls on load. The user gets a javascript error saying that a client-side event handler (in the below case, Toolbar_Clicked) is undefined. This happens in all versions of IE (but apparently not other browsers). It doesn't seem to happen locally, but it will happen when accessing our site over the Internet. If the user loads a page say 10 times, it will happen half the time. All of our pages have a mix of Telerik controls but this seems to happen mostly when there is a splitter control on the page. Stepping into the browser debugger, the code will look something like this:

WebForm_InitCallback();Telerik.Web.UI.RadSplitter._preInitialize("Radsplitter1");Telerik.Web.UI.RadPane._preInitialize("Radpane1", "Radsplitter1", "", "Radsplitbar1",  0, 0, "False");Telerik.Web.UI.RadSplitBar._preInitialize("Radsplitbar1", "Radsplitter1", "Radpane1", "Radpane2", 1, 0);Telerik.Web.UI.RadPane._preInitialize("Radpane2", "Radsplitter1", "Radsplitbar1", "",  2, 1, "True");Sys.Application.initialize();
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadAjaxManager, {"_updatePanels":"","ajaxSettings":[{InitControlID : "ClientGroupGrid",UpdatedControls : [{ControlID:"ClientGroupGrid",PanelID:""}]},{InitControlID : "ClientGrid",UpdatedControls : [{ControlID:"ClientGrid",PanelID:""}]}],"clientEvents":{OnRequestStart:"",OnResponseEnd:""},"defaultLoadingPanelID":"","enableAJAX":true,"enableHistory":false,"links":[],"styles":[],"uniqueID":"RadAjaxManager1","updatePanelsRenderMode":0}, null, null, $get("RadAjaxManager1"));
});
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadToolBar, {"_skin":"Professional","attributes":{},"clientStateFieldID":"ClientGroupToolbar_ClientState","collapseAnimation":"{\"type\":0,\"duration\":0}","expandAnimation":"{\"duration\":450}","itemData":[{"commandName":"NEW","cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/createtool.gif"},{"commandName":"EDIT","enabled":false,"cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/edittool.gif","disabledImageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/edittool_dis.gif"},{"commandName":"DELETE","enabled":false,"cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/deltool.gif","disabledImageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/deltool_dis.gif"},{"enabled":false,"cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/toolsep.gif"},{"commandName":"FILTERS","checkOnClick":true,"group":"Filter","checked":true,"allowSelfUnCheck":true,"cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/filttool.gif"},{"commandName":"CLIENTS","checkOnClick":true,"group":"Pane","allowSelfUnCheck":true,"cssClass":" rtbWrap","imageUrl":"/CSCMStaging/vlib/App_Themes/Professional/img/docs.gif"}]}, {"buttonClicked":Toolbar_Clicked,"load":_toolbarOnLoad}, null, $get("ClientGroupToolbar"));
});

The error is on the Sys.Application.add_init() line for the toolbar. The "buttonClicked" attribute is being set to a client-side function, Toolbar_Clicked, which apparently doesn't exist yet in the script DOM. Again, there are no script errors or any other problems on the page itself typically, since it loads properly half the time. It seems like some kind of timing/sync issue. Any help would be greatly appreciated.

Mike Oliver
Infotrieve, Inc.


Q2 2010 Release
Dustin
Top achievements
Rank 1
 answered on 04 Nov 2010
3 answers
114 views
Greetings...

I'm attempting to implement the code from the Related ComboBoxes demo using a Country/State combination. My issue is that I'm doing so in a Popup GridEditForm Template. I'm running into problems with gaining access to the State combo. In the demo, you are using the PageLoad event and a $find("<%= RadComboBox2.ClientID %>"); statement to set a global variable to be used later. Obviously this isn't an option with the GridEditForm Template.

Is there a way to gain access to that second ComboBox in the GridEditFormTemplate so I can kick off the requestItems with the value of the first ComboBox?

Your assistance is much appreciated.
Philip Senechal
Top achievements
Rank 1
 answered on 04 Nov 2010
1 answer
98 views
Dear Forum,

Please assist! This is my first attempt at using RadFilter with RadGrid and it does work, but the entire page insists upon posting back and I cannot work out how to keep that from happening. I would like the page to work in exactly the same manner as the example
http://demos.telerik.com/aspnet-ajax/filter/examples/saveloadexpressions/defaultcs.aspx
My page does not seem to know that it should be using AJAX for a partial page postback and I don't get the page loading rotating circle image either. I have copied the entire example page and used my radgrid and data source in place of the example radgrid and data source, but still the entire page posts back. What is the deal? Any ideas?

Thanks,
Celeste
Celeste
Top achievements
Rank 1
 answered on 04 Nov 2010
1 answer
131 views
Hi,

i want to know what i can do against this fail buildup:

http://desmond.yfrog.com/Himg839/scaled.php?tn=0&server=839&filename=failtreeview.png&xsize=640&ysize=640

I used LoadOnDemand approach ServerSide and ServerSideCallBack.

Failing in IE 7.0.5xxxx
Working correct in Firefox 3.5

thanks Mario

Mario
Top achievements
Rank 2
 answered on 04 Nov 2010
3 answers
61 views
Hi,

Here is an interesting issue that a customer brought up:

In FireFox, in a modal popup window with the editor is in DIV mode.  Copy some text from MS Word into the editor.

Close the editor in such a way to save the data (our app saves to a database).

Reopen the editor reading the data from your data store.

Hi-lite all the text (ctrl-a)  Click the Delete key.  Notice that the text does not delete.  You can't delete the text until you type a character at the end or beginning of your pasted text.  This is only a FireFox issue.  Does not happen in Safari or IE. (Haven't testing in Chrome)

Sometimes you don't have to save the pasted text, editing just gets hosed right after pasting.

This feature was introduced sometime in the last 2 versions. (We have a site running an older version of the tools.)

Here is our editor definition in the markup:

 

 

<telerik:RadEditor ID="txtItemSubject" runat="server"
EnableResize="False"

 

 

Width="590" Height="110"

 

EditModes="Design, html"

 

SpellCheckSettings-AllowAddCustom="false"

 

 

 

SpellCheckSettings-DictionaryLanguage="en-US"
SpellCheckSettings-SpellCheckProvider="TelerikProvider"

 

 

 

OnClientPasteHtml="OnClientPaste"

 

 

 

StripFormattingOnPaste="AllExceptNewLines"

 

 

 

ContentAreaMode="Div"

 

 

 

Contentfilters="MozEmStrong, EncodeScripts"

 

 

 

OnClientModeChange="OnClientModeChange"

 

 

 

OnClientLoad="OnRadEditorClientLoad">

 

 

OnClientPaste only checks the length of the text pasted - not modifications are done to the paste. 
OnRadEditorClientLoad resizes the client area so the sizing is the same between browsers - again, not modifying the text.

This is repoducable with any text from Word.  (I just opened a random word doc and copied from several different line and could repro this regardless of the line - so it's not Word doc specific.

Thanks!
Rich

Dobromir
Telerik team
 answered on 04 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?