Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
175 views
I am working with a datasource that uses a 5 character code as the fileid & PK. This code can contain any printable character, so I have some fileid(s) that shape up like this: AAA/>, AAA:/, etc.

In RadGrid, I have added this field to the DataKeyFields and access it in grid_itemCreated() to build a javascript link used in a button column.

Here is the problem, the FileID is 'AAA/>' but the code below extracts the fileid from the keyvalue as 'AAA//>'
and causes a "no records found" since the primary key has an extra / in it.

I cannot locate the place where this / is being added nor eliminate it on extract, any ideas?
protected void dg_results_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
            editLink.Attributes["href"] = "#";
            editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["FileId"], e.Item.ItemIndex);
                 }
    }
Tsvetina
Telerik team
 answered on 05 Nov 2010
2 answers
251 views
Hello,

I have a RadGrid with one detailtable.
Both the MasterTableView as the DetailTable GridTableView have the following CommandItemTemplate
<CommandItemTemplate>
  <div style="padding: 5px 5px 5px 5px; float: right; display: inline">
    <asp:LinkButton ID="RebindButton" runat="server" CommandName="RebindGrid" ToolTip="Refresh">
      <asp:Image ID="RebindImage" runat="server" ImageUrl="~/Images/Refresh.gif" ImageAlign="Middle" />
    </asp:LinkButton>
  </div>                                            
</CommandItemTemplate>

When i click the refresh button on the DetailTable, the MasterTableView gets rebound.
Is it possible to only have the DetailTable GridTableView to rebind?

Kind regards.
Jeroen Eikmans
Top achievements
Rank 1
 answered on 05 Nov 2010
1 answer
112 views
I was on the sitefinity demo site and in the radeditor there I pasted in some html into the html mode tab...swapped between design and html modes...and it was all properly formatted (indented, not one giant string)

I went over to the site I was working on and they have a newer version of the RadEditor and it DOESNT do that...

Where can I enable this? :)

Steve
Rumen
Telerik team
 answered on 05 Nov 2010
1 answer
453 views
Hi,
I have top and bottom panels. Top panel wraps a RadGrid, bottom panel wraps a text box and a save button. If the height of a grid is larger than the container, I want to display  grid  with a focus on last row. I know how to do this in asp.net Gridview but couldnot find the currentcell property for RadGrid.

In ASP.NET GRIDVIEW, given below is the code to focus on last row;
 dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0];

Can someone help me out on this?

Thanks!
Prava
       
Shinu
Top achievements
Rank 2
 answered on 05 Nov 2010
1 answer
115 views
Hello,
I have a simple form consisting of :
- raddatetimepicker
- checkbox

I want to validate raddatetimepicker to see whether or not the user enters the date& time when the checkbox control is checked.
If the checkbox is unchecked, no validation is occurred.

How do I accomplished this?

Thanks
Brew
Shinu
Top achievements
Rank 2
 answered on 05 Nov 2010
1 answer
167 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
94 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
260 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
144 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
390 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?