Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
99 views
hi,
i'm trying to use a radgrid.
I have a grid with 2 colums defined in aspx and by behind code i insert some others colums.
i put the colums in the grid in the correct order.
When i run the page the radgrid is correct but when i make sort and change page the grid loses some colums and shows the colums in a strange way without respect my order.

this is my aspx code:

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="sqlDataSource1" AllowPaging="true"
           AllowSorting="true"  PageSize="15" Width="100%" Height="600px" AutoGenerateColumns="false"  >
         <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView>
                <Columns>
                    <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="alfa" Text="Alfa"/>
                    <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="delta" Text="Delta"/>
                    
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True"></Scrolling>
            </ClientSettings>
        </telerik:RadGrid>

this is my colums insert :
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim bc As Telerik.Web.UI.GridBoundColumn
        bc = New Telerik.Web.UI.GridBoundColumn()
        bc.DataField = "IDBatch"
        bc.HeaderText = "ID batch"

        RadGrid1.MasterTableView.Columns.Insert(0, bc)

        bc.DataField = "Type"
        bc.HeaderText = "Type"

        RadGrid1.MasterTableView.Columns.Insert(1, bc)
      

    End Sub

someone can help me?
thanks

incrysis incrysis
Top achievements
Rank 1
 answered on 18 Jan 2010
2 answers
84 views
Hi Telerik,

I'm using ASP.NET AJAX RadControls Q3 2009 and I got problem with RadDatePicker.

Here is the code

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
    <title>Test Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"> 
        <telerik:RadScriptBlock ID="RadCodeBlock" runat="server"> 
            <script type="text/javascript"> 
                function OnDateSelected(sender, e) 
                { 
                    if(!sender.isEmpty()) 
                    { 
                        var startDate = sender.get_selectedDate(); 
                        var rdpRequestedEndDate = $find("<%= rdpRequestedEndDate.ClientID %>"); 
                         
                        rdpRequestedEndDate.set_selectedDate(startDate); 
                        rdpRequestedEndDate.set_minDate(startDate); 
                    } 
                } 
            </script> 
        </telerik:RadScriptBlock>     
         
        <telerik:RadScriptManager ID="ScriptManager" runat="server" /> 
         
        <table> 
            <tr> 
                <td class="tdLabel" style="text-align: right;"> 
                    <asp:Label ID="lblRequestedStartDateLabel" Text="Requested Start Date:" runat="server" 
                        meta:resourcekey="lblRequestedStartDate"></asp:Label> 
                </td> 
                <td style="text-align: left; "> 
                    <telerik:RadDatePicker ID="rdpRequestedStartDate"  
                            DateInput-DisplayDateFormat="dd-MMM-yyyy" runat="server" MinDate="<%#DateTime.Now %>"> 
                        <Calendar ID="Calendar1" runat="server"> 
                        </Calendar> 
                        <ClientEvents OnDateSelected="OnDateSelected" /> 
                    </telerik:RadDatePicker> 
                </td> 
            </tr> 
             
            <tr> 
                <td class="tdLabel" style="text-align: right; "> 
                    <asp:Label ID="lblRequestedEndDateLabel" Text="Requested End Date:" runat="server" 
                       meta:resourcekey="lblRequestedEndDateLabel"></asp:Label> 
                </td> 
                <td style="text-align: left; "> 
                    <telerik:RadDatePicker ID="rdpRequestedEndDate" runat="server" MinDate="<%#DateTime.Now %>" 
                        DateInput-DisplayDateFormat="dd-MMM-yyyy"> 
                        <Calendar ID="Calendar2" runat="server" Skin="WebBlue"> 
                        </Calendar> 
                    </telerik:RadDatePicker> 
                </td> 
            </tr> 
        </table> 
    </form> 
</body> 
</html> 

I have two RadDatePicker. The only event is changing the RequestedEndDate on RequestedStartDate_Selected.
If I change the RequestedEndDate first, then change the RequestedStartDate; it will throw an error "Object required" (I use the IE Developer tool to debug the error on IE browser). The Javascript line which makes error seems to be "rdpRequestedEndDate.set_minDate(startDate); ".

Please help me to solve this issue.
Thanks a lot.

Chelsea Leonhart
Top achievements
Rank 1
 answered on 18 Jan 2010
4 answers
166 views
I'm going crazy ;-)
I can't figure out how I can disable the default enabled All Day Event on the advanced form.

No matter what I do, then it shows up enabled when I create a new appointment.

I use the Entity Framework as datasource

Please advise !

Thanks
Jan
Peter
Telerik team
 answered on 18 Jan 2010
1 answer
100 views
Hello,

I want the appointment title to be a link holding a URL. How to do that? I tried setting the link markup to the appointment subject. But it is not getting rendered as a link.

Thank you.
NLV
NLV
Top achievements
Rank 1
 answered on 18 Jan 2010
3 answers
273 views
Hi all:

I have a ASP.NET page that has a Tabbed interface, 4 data grids, some images, text., etc. I'd like to get all of this content into the RadEditor at Run time...is this possible? I have been able to get string content into the Editor, but is it possible to build a table from a RadGrid and then add that table to the Editor? Is it possible to add and format headers, images, etc?

Thanks for any and all input.

John.
Rumen
Telerik team
 answered on 18 Jan 2010
1 answer
50 views
Hello,
We are using Telerik version 2009.We have used radGrid in our application.When we run the application on windows XP ,we get the radGrid in blue color.however when we are using Vista Machine,we are getting dark gray color for the grid.We are using"Web Blue" skin for the radGrid. We want  to appear the grid a with the same color on both Vista and Windows XP machine.Is there any property to set for grid and buttons to resolve the problem?

Please Provide the solution.

Regards,
Rahul.
Dimo
Telerik team
 answered on 18 Jan 2010
1 answer
232 views
Is it possible to select a row in a radgrid based on a cell value e.g. column ID, and we want to select row with cell of ID = 12?
Shinu
Top achievements
Rank 2
 answered on 18 Jan 2010
2 answers
262 views
I recently upgraded from 2008 Q1 to 2009 Q3 Controls, and my custom styles are no longer working.

The older controls I was able to do this and achieve what I wanted:

.GridRowOver_Sunset 
{ 
    background:#fdd0b7 url('images/sprite.gif') 0 -200px repeat-x !important; 
    cursor:pointer; 
} 
 
.SelectedRow_Sunset 
{ 
    background:#fdd0b7 url('images/sprite.gif') 0 -200px repeat-x !important; 
} 
 
.SelectedRow_Sunset td 
{ 
    border-top:1px solid #d07052; 
    border-bottom:1px solid #d07052; 
} 

But this does not work with the new controls.  What do I need to change?
Dimo
Telerik team
 answered on 18 Jan 2010
1 answer
150 views
Hi,

How can i use a dropdownlist ( ddlCategory) to display the value in each row in non editmode?
How can i populate the ddlCategory with dsddl as dataset? (cant use sqldatasource here!)

reg.

D
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="InPlace.aspx.vb" Inherits="InPlace" %> 
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head id="Head1" runat="server"> 
</head> 
<body class="BODY"> 
    <form id="mainForm" runat="server"> 
    <asp:ScriptManager ID="ScriptManager1" runat="server"> 
    </asp:ScriptManager> 
    <!-- content start --> 
 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
 
        <script type="text/javascript"> 
            function RowDblClick(sender, eventArgs) { 
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical()); 
            } 
        </script> 
 
    </telerik:RadCodeBlock> 
   
    <telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True" 
        AllowAutomaticInserts="True" PageSize="10" OnItemCommand="onitemcommand_radgrid1" 
        AllowAutomaticUpdates="True" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="sqldatasource2"> 
        <PagerStyle Mode="NextPrevAndNumeric" /> 
        <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="ProductID" 
            DataSourceID="Sqldatasource2" HorizontalAlign="NotSet" AutoGenerateColumns="False"> 
            <Columns> 
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> 
                    <ItemStyle CssClass="MyImageButton" /> 
                </telerik:GridEditCommandColumn> 
                <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" 
                    UniqueName="ProductName" ColumnEditorID="GridTextBoxColumnEditor1"> 
                </telerik:GridBoundColumn> 
                <telerik:GridTemplateColumn HeaderText="CategoryName"> 
                    <ItemTemplate> 
                        <asp:DropDownList ID="ddlCategory" runat="server" DataTextField="CategoryName" DataValueField="CategoryID"> 
                        </asp:DropDownList> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridNumericColumn DataField="UnitsInStock" HeaderText="Units In Stock" SortExpression="UnitsInStock" 
                    UniqueName="UnitsInStock" ColumnEditorID="GridNumericColumnEditor1"> 
                </telerik:GridNumericColumn> 
                <telerik:GridBoundColumn DataField="QuantityPerUnit" HeaderText="Quantity Per Unit" 
                    SortExpression="QuantityPerUnit" UniqueName="QuantityPerUnit" Visible="false" 
                    EditFormColumnIndex="1" ColumnEditorID="GridTextBoxColumnEditor2"> 
                </telerik:GridBoundColumn> 
                <telerik:GridCheckBoxColumn DataField="Discontinued" HeaderText="Discontinued" SortExpression="Discontinued" 
                    UniqueName="Discontinued" EditFormColumnIndex="1"> 
                </telerik:GridCheckBoxColumn> 
                <telerik:GridTemplateColumn HeaderText="UnitPrice" SortExpression="UnitPrice" UniqueName="TemplateColumn" 
                    EditFormColumnIndex="1"> 
                    <ItemTemplate> 
                        <asp:Label runat="server" ID="lblUnitPrice" Text='<%# Eval("UnitPrice", "{0:C}") %>'></asp:Label> 
                    </ItemTemplate> 
                    <EditItemTemplate> 
                        <span> 
                            <telerik:RadNumericTextBox runat="server" ID="tbUnitPrice" Width="40px" DbValue='<%# Bind("UnitPrice") %>'> 
                            </telerik:RadNumericTextBox><span style="color: Red"><asp:RequiredFieldValidator 
                                ID="RequiredFieldValidator1" ControlToValidate="tbUnitPrice" ErrorMessage="*" 
                                runat="server"> 
                            </asp:RequiredFieldValidator></span> 
                    </EditItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow" 
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                    UniqueName="DeleteColumn"> 
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                </telerik:GridButtonColumn> 
            </Columns> 
            <EditFormSettings ColumnNumber="2" CaptionDataField="ProductName" CaptionFormatString="Edit properties of Product {0}"> 
                <FormTableItemStyle Wrap="False"></FormTableItemStyle> 
                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> 
                <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White" 
                    Width="100%" /> 
                <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" /> 
                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> 
                <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record" 
                    UniqueName="EditCommandColumn1" CancelText="Cancel edit"> 
                </EditColumn> 
                <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle> 
            </EditFormSettings> 
        </MasterTableView> 
        <ClientSettings> 
            <ClientEvents OnRowDblClick="RowDblClick" /> 
        </ClientSettings> 
    </telerik:RadGrid> 
    <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="200px" /> 
    <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor2" runat="server" TextBoxStyle-Width="150px" /> 
    <telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor1" runat="server" 
        DropDownStyle-Width="110px" /> 
    <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server" NumericTextBox-Width="40px" /> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"> 
    </telerik:RadWindowManager> 
    <br /> 
    <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT ProductID, ProductName, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, Discontinued FROM [Products]" 
        runat="server"></asp:SqlDataSource> 
    </form> 
</body> 
</html> 
 

Imports Telerik.Web.UI 
Imports System 
Imports System.Data 
Imports System.Data.SqlClient 
Imports System.Web.UI.WebControls 
Imports System.Configuration 
 
Imports System.Drawing 
 
Partial Class InPlace 
    Inherits System.Web.UI.Page 
 
    Dim ConnString As String = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString 
 
    Public Function dsddl() As DataSet 
        Dim conn As SqlConnection = New SqlConnection(ConnString) 
        Dim adapter As SqlDataAdapter = New SqlDataAdapter 
        Dim myDataSet As DataSet = New DataSet 
 
        conn.Open() 
        Try 
 
            adapter.SelectCommand = New SqlCommand("SELECT * from Categories", conn) 
            adapter.Fill(myDataSet, "cats") 
        Finally 
            conn.Close() 
        End Try 
        Return myDataSet 
 
    End Function 
 
 
 
    Protected Sub onitemcommand_radgrid1(ByVal source As Object, ByVal e As GridCommandEventArgs) 
        Dim item As GridItem 
        Dim ddl As DropDownList 
 
        item = e.Item 
        If e.CommandName = RadGrid.EditCommandName Then 
            RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace 
            'initialize dropdownlist 
            If item.ItemType = GridItemType.Item Then 
                ddl = CType(item.FindControl("ddlCategory"), DropDownList) 
                ddl.DataSource = dsddl() 
                ddl.DataTextField = "CategoryName" 
                ddl.DataValueField = "CategoryID" 
                ddl.DataBind() 
 
            End If 
 
        End If 
        If e.CommandName = RadGrid.InitInsertCommandName Then 
            RadGrid1.MasterTableView.EditMode = GridEditMode.EditForms 
        End If 
    End Sub 
 
  
End Class 
 

Shinu
Top achievements
Rank 2
 answered on 18 Jan 2010
2 answers
170 views
Hi there!
I've got a RadGrid with a GridHyperlinkColumn and a dynamic RadToolTip on it. My question: Is it possible to disable the HTML-title-Tag of this hyperlinks, so I have only the RadToolTip? It would be awesome... ;)

Thanks.
Ti
Top achievements
Rank 1
 answered on 18 Jan 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?