Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
168 views
I have a very nice grid layout that has everything aligned perfectly except my decorated button, I see that it wraps my input button into an anchor tag in Firebug. I tried adding margin to the top of the anchor tag but that just causes my entire row to shift not the individual button. If I add padding to the anchor it causes all of the image assumptions to become messed up and makes the button not look right.

Is there a known solution to making this be vertically aligned in the middle as opposed to the top of the parent element?
Robert
Top achievements
Rank 1
 answered on 16 Oct 2009
1 answer
167 views
Hi,

GridTemplateColumn fileds didnt update table fields. Other fields are update ok. Why GridTemplateColumn  dont update table?

I have bold all the template column and parameters

 <telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="False" DataSourceID="sqlInfTRans"
            GridLines="None" Skin="Web20" AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
            AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" EditMode="InPlace" DataMember="DefaultView">
<MasterTableView DataKeyNames="ITransID" CommandItemDisplay="TopAndBottom" AutoGenerateColumns="False" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"
                 >
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridButtonColumn CommandName="Select" Text="Select"
            UniqueName="column">
        </telerik:GridButtonColumn>
     
        
        <telerik:GridTemplateColumn UniqueName="IReasonforIssueID" HeaderText="IReasonforIssueID">
        
        <ItemTemplate>        
                <asp:Literal ID="ltrREason" runat="server"  Text ='<%#Eval("IReasonForIssueDesc") %>' ></asp:Literal>
        
        </ItemTemplate>
        <EditItemTemplate>
        
         <telerik:Radcombobox runat="server"
                                             ID="rcmReason"
                                             DataTextField="IReasonForIssueDesc"
                                             DataValueField="IReasonforIssueID"
                                             HighlightTemplatedItems="true"
                                             Height="190px"
                                             Width="220px"
                                             DropDownWidth="420px"
                                             DataSourceID="lnkReason"
                                             SelectedValue='<%# DataBinder.GetDataItem("IReasonforIssueID") == null ? "" : (String)DataBinder.Eval(Container.DataItem, "IReasonforIssueID") %>'
                                             EnableItemCaching="True"
                                             EnableLoadOnDemand="True"
                                             emptymessage="Please select one..."
                                             allowcustomtext="True" MarkFirstMatch="True">
                                             </telerik:RadComboBox>
                                               

        
        </EditItemTemplate>
        
        </telerik:GridTemplateColumn>

        
        
        
        <telerik:GridBoundColumn DataField="IOurDocRev" HeaderText="IOurDocRev"
            UniqueName="IOurDocRev">
        </telerik:GridBoundColumn>
        
        <telerik:gridtemplatecolumn UniqueName="IOurTransRetDate"
                                          HeaderText="IOurTransRetDate">
                                         <ItemTemplate>
                                         
                                         <asp:Literal ID="TDate" runat="server"     Text ='<%#Bind("IOurTransRetDateF") %>' ></asp:Literal>
                                         
                                            
                                         
                                         </ItemTemplate>
                                         
                                         <EditItemTemplate>
                                             <telerik:raddatepicker ID="RadIOurTransRetDate" runat="server"
                                                 DbSelectedDate=<%#Eval("IOurTransRetDateF") %> Width="100px"  
                                                 DateInput-DateFormat="dd/MM/yyyy"  >
                                             </telerik:RadDatePicker>
                                         
                                         </EditItemTemplate>
                                         </telerik:GridTemplateColumn>     

                                         
        
     
        <telerik:GridBoundColumn DataField="IOurRtrnTransNo"
            HeaderText="IOurRtrnTransNo" UniqueName="IOurRtrnTransNo">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="OurRtrnCodeID" HeaderText="OurRtrnCodeID"
            UniqueName="OurRtrnCodeID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="IfaceDocRev" HeaderText="IfaceDocRev"
            UniqueName="IfaceDocRev">
        </telerik:GridBoundColumn>
        
        
         <telerik:gridtemplatecolumn UniqueName="IfaceTransDate"
                                          HeaderText="IfaceTransDate">
                                         <ItemTemplate>                                         
                                         <asp:Literal ID="OurTransRetDate" runat="server"     Text ='<%#Bind("IfaceTransDateF") %>' ></asp:Literal>
                                                                                    
                                         
                                         </ItemTemplate>
                                         
                                         <EditItemTemplate>
                                             <telerik:raddatepicker ID="RadIfaceTransDate" runat="server"
                                                 DbSelectedDate='<%#Eval("IfaceTransDateF") %>' Width="100px"  
                                                 DateInput-DateFormat="dd/MM/yyyy"  >
                                             </telerik:RadDatePicker>
                                         
                                         </EditItemTemplate>
                                         </telerik:GridTemplateColumn>  

                                         
                                         
        
        
        
        <telerik:GridBoundColumn DataField="IfaceTransNo" HeaderText="IfaceTransNo"
            UniqueName="IfaceTransNo">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
        </telerik:RadGrid>


        <asp:LinqDataSource ID="lnkReason" runat="server" ContextTypeName="DataClassesDataContext"
        TableName="tbl_LU_InterfacerReasonForIssues" AutoPage="False">
        </asp:LinqDataSource>                          
    
    </div>   
                          
       <asp:SqlDataSource ID="sqlInfTRans"
                                    
                            ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"
                            SelectCommand="SELECT convert(varchar(10),IfaceTransDate,103) as IfaceTransDateF,convert(varchar(10),IOurTransRetDate,103) as IOurTransRetDateF, * from  qry_DATA_InterfacerTransmittals WHERE (DocNo = @DocNo) and ICompanyCode=@ICompanyCode "
                            DeleteCommand ="Delete from [tbl_DATA_InterfacerTransmittals] where ITransID=@ITransID"
                            
                            InsertCommand="insert into tbl_DATA_InterfacerTransmittals ([DocNo],[ICompanyCode],IReasonforIssueID,IOurDocRev,IOurTransRetDate,IOurRtrnTransNo,OurRtrnCodeID,IfaceDocRev,IfaceTransDate,IfaceTransNo)
                            values(@DocNo,@ICompanyCode,@IReasonforIssueID,@IOurDocRev,@IOurTransRetDate,@IOurRtrnTransNo,@OurRtrnCodeID,@IfaceDocRev,@IfaceTransDate,@IfaceTransNo)"
                            
                            
                            UpdateCommand="update tbl_DATA_InterfacerTransmittals set [IReasonforIssueID]=@IReasonforIssueID,IOurDocRev=@IOurDocRev,IOurTransRetDate=@IOurTransRetDate,
                            IOurRtrnTransNo=@IOurRtrnTransNo,OurRtrnCodeID=@OurRtrnCodeID,IfaceDocRev=@IfaceDocRev,IfaceTransDate=@IfaceTransDate,IfaceTransNo=@IfaceTransNo where ITransID=@ITransID"
                            runat="server">
                                                                               
                                    
                                    <SelectParameters>                                                                           
                                        <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />
                                       <asp:ControlParameter ControlID="Label2" PropertyName="Text" Type="String" Name="ICompanyCode" />

                                    </SelectParameters>
                                    <DeleteParameters>
                                        <asp:Parameter Name="ITransID" Type="Int32" />
                                    
                                    </DeleteParameters>
                                    
                                <UpdateParameters>
                                    <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />
                                    <asp:Parameter Name="ITransID" Type="Int32" />            
                                    <asp:ControlParameter ControlID="Label2" PropertyName="Text" Type="String" Name="ICompanyCode" />

                                    <asp:Parameter Name="IReasonforIssueID" Type="String" />
                                    <asp:Parameter Name="IOurDocRev" Type="String" />
                                    <asp:Parameter Name="IOurTransRetDate" Type="String" />
                                    <asp:Parameter Name="IOurRtrnTransNo" Type="String" />
                                    <asp:Parameter Name="OurRtrnCodeID" Type="String" />
                                    <asp:Parameter Name="IfaceDocRev" Type="String" />                                    
                                    <asp:Parameter Name="IfaceTransDate" Type="String" />
                                    <asp:Parameter Name="IfaceTransNo" Type="String" />                                                              
                                </UpdateParameters>
                                    
                        <InsertParameters>
                                                                     
                                    <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />
                                    <asp:ControlParameter ControlID="Label2" PropertyName="Text" Type="String" Name="ICompanyCode" />
                                     
                                    <asp:Parameter Name="IReasonforIssueID" Type="String" />
                                    <asp:Parameter Name="IOurDocRev" Type="String" />
                                    <asp:Parameter Name="IOurTransRetDate" Type="String" />
                                    <asp:Parameter Name="IOurRtrnTransNo" Type="String" />
                                    <asp:Parameter Name="OurRtrnCodeID" Type="String" />
                                    <asp:Parameter Name="IfaceDocRev" Type="String" />                                    
                                    <asp:Parameter Name="IfaceTransDate" Type="String" />
                                    <asp:Parameter Name="IfaceTransNo" Type="String" />
                                    
                          </InsertParameters>                                    
                                </asp:SqlDataSource>

Pavlina
Telerik team
 answered on 16 Oct 2009
4 answers
158 views

Hi, i am trying to use the file explorer on a page which has a master page of which the controls (text boxes) on the pages are genarated from a usercontrol, i'm trying to have two text boxes which both link to the file explorer using the file seletor dialog demo http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/fileselectordialog/defaultcs.aspx, everything seems to work apart from when i click the files on file explorer the window shuts but my file paths are not transfered to the text boxes , below is the code that is genarated from one of the usercontrols on the page which look like its passing the corrent name of the control but i'm not sure if i am mising something? any help would be great

renderd usercontrol
<input name="ctl00$ContentPlaceHolder3$HomeBannerZone2$TXBHeadingLink" type="text" value="some text" id="ctl00_ContentPlaceHolder3_HomeBannerZone2_TXBHeadingLink" style="width:500px;" />

Renderd Java
  function OnFileSelected(wnd, fileSelected)
        {
            var textbox = $get("ctl00_ContentPlaceHolder3_HomeBannerZone2_TXBHeadingLink");
            textbox.value = fileSelected;
        }

Fiko
Telerik team
 answered on 16 Oct 2009
6 answers
139 views
Hi,
I am using RadTreeView from telerik Radcontrols for ASP.Net ajax q2 2009 and RadAjax from telerik radcontrols for asp.net (version 1.8.5) in a page.
on page load everything works fine but when the panel which contains treeview is updated by Ajax Manager, every functionality of treeview is gone.
Before this i had RadTreeView for asp.net (version 6.0.3) and everything worked fine.
but when I upgraded it to asp.net ajax the problem above appeared.

what should I do?



Amir
Top achievements
Rank 1
 answered on 16 Oct 2009
1 answer
70 views
I am using this piece of code for setting the pagestyle.

<

 

PagerStyle Mode="NextPrevAndNumeric" />

 

You can see in the attachment when it renders on the page, there is "select" text displayed adjacent to page size. This happens on the content page. I am using the grid in couple of other pages in the app, it renders fine. so not sure whats going on here.


Dimo
Telerik team
 answered on 16 Oct 2009
1 answer
211 views
Hi,

I was wondering if it is possible to apply more than one style to rows in a RadGrid. What I mean by this is I have 2 lists I am grabbing information from and adding it to a DataTable which I then bind to the RadGrid. I enumerate through the first list adding the items to the DataTable then the second and and adding the items to the same DataTable. In the rad grid I set the style property as follows:

_theListGrid.MasterTableView.ItemStyle.CssClass =

"listItemBg";

but this applies the style to all of my items.
Is it possible to set the style somewhere else so that my first list has one style and my second list has a different style and for these items to all be in the same RadGrid? If not is there a different approach I can take to have multiple styles?

Thank You

 

Dimo
Telerik team
 answered on 16 Oct 2009
2 answers
236 views
Hi,

I have a RadGrid with AutoGenerateColumns= true. I tried adding a RequiredFieldValidator as described in http://www.telerik.com/help/aspnet/grid/grdvalidation.html. 
I hooked up the validator in the ItemCreated event and this works fine (the validator performs as expected). The problem however, arises when the update button is pressed. 

When in try to call:
item.OwnerTableView.ExtractValuesFromItem(newValues, item);  // item is GridEditableItem 
the returned values for the items with a validator attached are always null. The values for items without a validator are returned correctly.

 I suspect the problem arises from the AutoGenerateColumns= true (or the documentation on the subject is just plain wrong, which i suspect is not the case). Is there a workaround for this issue? 

I'm currently using Telerik.Web.UI.dll version 2009.1.311.35
Sebastian
Telerik team
 answered on 16 Oct 2009
1 answer
160 views
Hi Telerik Team,

Is there anyway to get the cursor position (caret position) in the server side code (C#) rather then in javascript? Also is there anyway to find out what text a user has selected using server side code?

I basically have 2 buttons that when clicked do certain things:

1. Needs to find the cursor position and then select all the text on the line within the text box where the cursor (caret) is placed.
2. Needs to just be able to find all the text that a user has selected

there is a third button but this just gets all the text in the text box and can easily use RadTextBox.Text

Thanks in advance

Ian Ramsay
Programmer
Imagered Ltd
http://www.imagered.co.uk
Dimo
Telerik team
 answered on 16 Oct 2009
1 answer
132 views
Hello,

I have a DNN module, and I use RadGrid from "RadControls for ASP.NET AJAX" version 2009.2 826 (Aug 26, 2009)
The grid works perfect in the IE6, IE7, FireFox and Opera. But I have trouble in the IE8.
There is not display paging for detail tables in the grid
Please look at picture, I have marked it red color, and it does not display in IE8
I have tryed to add
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
on the page, but it did not help

Have anyone others ideas how I can fix it?



Sebastian
Telerik team
 answered on 16 Oct 2009
2 answers
108 views
HI,

I am able to add the rows dynamically and preserve the state of it when I just have one radcombo and one textbox, but when I have 2 related radcombobox's (instead of a dropdown and a textbox) for each dynamic row created. On the selection of the first radcombobox's, the second should be populated (for eg. if the person selects state in the first radcombo, the second should populate with the list of states.) 
I tried doing this, I am binding the second drop down box on the selected_indexchange event of the first dropdown, that works fine, but now when I try to add a row , it gives me error on the radgrid.rebind(). Because it is not finding any items in the second radcombobox after the reload.
Any help on this.
<telerik:RadGrid ID="RadGrid1" AutoGenerateColumns="false" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" >  
                <MasterTableView>  
                    <Columns>   
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn2" HeaderText="Filter Type">  
                            <ItemTemplate>  
                                <telerik:RadComboBox ID="rcbFilterType" AppendDataBoundItems="true" SelectedValue='<%#Eval("Selected1") %>' runat="server" OnSelectedIndexChanged="rcbFilterType_SelectedIndexChanged" AutoPostBack="true"> 
                                <Items> 
                                <telerik:RadComboBoxItem Value="" Text=""/> 
                                <telerik:RadComboBoxItem Value="0" Text="Keyword"/> 
                                <telerik:RadComboBoxItem Value="1" Text="State"/> 
                                <telerik:RadComboBoxItem Value="2" Text="Provider"/> 
                                <telerik:RadComboBoxItem Value="3" Text="Faculty"/> 
                                </Items> 
                                </telerik:RadComboBox> 
                            </ItemTemplate>  
                        </telerik:GridTemplateColumn>  
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn1" HeaderText="Filter Options">  
                            <ItemTemplate>  
                                <telerik:RadComboBox ID="rcbFilterOptions" AppendDataBoundItems="true" SelectedValue='<%#DataBinder.Eval(Container.DataItem,"Selected2") %>' runat="server"> 
                                </telerik:RadComboBox> 
                            </ItemTemplate>  
                        </telerik:GridTemplateColumn>  
                         
                    </Columns>  
                </MasterTableView>  
        </telerik:RadGrid> 

Imports System.Web 
Imports System.Web.SessionState 
Imports System.Web.UI 
Imports System.Web.UI.WebControls 
Imports System.Web.UI.HtmlControls 
Imports System.Data 
Imports Telerik.Web.UI 
Imports System.Data.SqlClient 
 
Partial Class Dailog2 
    Inherits System.Web.UI.Page 
    Public dt As DataTable 
    Public _store As String = "FilterTable" 
 
    Protected Sub form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Form2.Load 
        If Not IsPostBack AndAlso ViewState("dt") = Nothing Then 
            If Session(_store) Is Nothing Then 
                dt = New DataTable() 
                dt.Columns.Add(New DataColumn("Selected1", GetType(String))) 
                dt.Columns.Add(New DataColumn("Selected2", GetType(String))) 
                'Cache.Remove(_store) 
            Else 
                dt = DirectCast(Session(_store), DataTable) 
            End If 
        Else 
            ' Cache.Remove(_store) 
            dt = DirectCast(ViewState("dt"), DataTable) 
 
        End If 
 
    End Sub 
 
    Private Function AddRow(ByVal dt As DataTable) As DataTable 
        ' method to create row         
        Dim dr As DataRow = dt.NewRow() 
        dr("Selected1") = "" 
        dr("Selected2") = "" 
        dt.Rows.Add(dr) 
        Return dt 
    End Function 
 
    Protected Sub Button1_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 
 
        Dim dt As DataTable = DirectCast(ViewState("dt"), DataTable) 
        For Each item As GridDataItem In RadGrid1.Items 
            Dim ddl1 As RadComboBox = DirectCast(item.FindControl("rcbFilterType"), RadComboBox) 
            Dim ddl2 As RadComboBox = DirectCast(item.FindControl("rcbFilterOptions"), RadComboBox) 
            Dim i As Integer = 0 
 
            While i < dt.Rows.Count 
                If iitem.ItemIndex = i Then 
                    dt.Rows(i)(0) = ddl1.SelectedValue 
                    dt.Rows(i)(1) = ddl2.SelectedValue 
                End If 
                System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1) 
            End While 
        Next 
 
        ViewState("dt") = AddRow(dt) 
        RadGrid1.Rebind() 
    End Sub 
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) 
        If Not IsPostBack Then 
            ViewState("dt") = dt 
            RadGrid1.DataSource = dt 
        Else 
            dt = DirectCast(ViewState("dt"), DataTable) 
            RadGrid1.DataSource = dt 
        End If 
    End Sub 
 
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click 
        Dim dt As DataTable = DirectCast(ViewState("dt"), DataTable) 
        For Each item As GridDataItem In RadGrid1.Items 
            Dim ddl1 As RadComboBox = DirectCast(item.FindControl("rcbFilterType"), RadComboBox) 
            Dim ddl2 As RadComboBox = DirectCast(item.FindControl("rcbFilterOptions"), RadComboBox) 
            Dim item1 As New RadComboBoxItem() 
            item1.Text = "key1" 
            item1.Value = "0" 
            Dim i As Integer = 0 
            While i < dt.Rows.Count 
                If iitem.ItemIndex = i Then 
                    dt.Rows(i)(0) = ddl1.SelectedValue 
                    dt.Rows(i)(1) = ddl2.SelectedValue 
                    
                End If 
 
                System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1) 
            End While 
        Next 
        If (Not ClientScript.IsStartupScriptRegistered("return")) Then 
            Page.ClientScript.RegisterStartupScript(Me.GetType(), "return", "returnToParent();", True) 
        End If 
    End Sub 
 
    Protected Sub rcbFilterType_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) 
        Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString) 
        Dim query As String = "" 
 
        Dim ddl1 As RadComboBox = CType(sender, RadComboBox) 
        Dim DataItem As GridDataItem = CType(ddl1.NamingContainer, GridDataItem) 
        Dim ddl2 As RadComboBox = DirectCast(DataItem.FindControl("rcbFilterOptions"), RadComboBox) 
 
        If ddl1.SelectedValue = 0 Then 
            query = "SELECT CategoryID as ID, CategoryName as NAME FROM Categories" 
        ElseIf ddl1.SelectedValue = 1 Then 
            query = "SELECT CategoryID as ID, CategoryName as NAME FROM Categories" 
        ElseIf ddl1.SelectedValue = 2 Then 
            query = "SELECT CategoryID as ID, CategoryName as NAME FROM Categories" 
        Else 
            query = "SELECT CategoryID as ID, CategoryName as NAME FROM Categories" 
        End If 
        Dim adapter As New SqlDataAdapter(query, connection) 
        Dim dt As New DataTable() 
        adapter.Fill(dt) 
 
        ddl2.DataTextField = "Name" 
        ddl2.DataValueField = "ID" 
        ddl2.DataSource = dt 
        ddl2.DataBind() 
    End Sub 
 
    
End Class 
 



Jay Mehta
Top achievements
Rank 1
 answered on 16 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?