Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
112 views
Hi,
Multiline textbox with maximum length is working in latest version of telerik but i have occurred a problem.Set maximum length in multiline textbox as 10  and enter the text as below

aaa
bbb
cc

after entering value check length of the textbox text ,It shows 12.This problem occurs in Mozilla and in IE.But it is working fine in chrome.I got a reply for this problem.

Telerik.Web.UI.RadInputControl.prototype._escapeNewLineChars_org = Telerik.Web.UI.RadInputControl.prototype._escapeNewLineChars;
Telerik.Web.UI.RadInputControl.prototype._escapeNewLineChars = function (text, replaceWith)
{
 return this._escapeNewLineChars_org(text, "  ");
}


Can i set this property dynamically from server side,becuase i have to create custom control based on multiline text box.So i cant include these script in each page.Expecting a fast reply from you.
Thanks
Shibin
Lalu
Top achievements
Rank 1
 answered on 19 Jun 2013
5 answers
370 views
We finally got our telerik.dll's updated to the current version and the DropDownAutoWidth works perfect for a standard radComboBox. If you create a multi-column (2 columns) radComboBox the DropDownAutoWidth has a very strange behavior. You can see in multi_1.jpg that the second column is not left justified and extends to the left (first time I click the dropdown). In multi_2.jpg, the second column is working its way towards the right and drop down is getting wider (second time I click the dropdown). In multi_3.jpg, the second column is left justified with the other rows and the drop down is even wider (third time I click the dropdown). I have tried this with several of the skins and they all behave the same way. This is my aspx code for the drop down.
<telerik:RadComboBox ID="radCBOMulti" runat="server" MarkFirstMatch="true" AllowCustomText="false"
    Width="150px" MaxHeight="300px" NoWrap="true" HighlightTemplatedItems="true"
    ExpandDirection="Down" ExpandDelay="0" CollapseDelay="0" DropDownAutoWidth="Enabled">
    <HeaderTemplate>
        <table style="width: 100%; text-align: left; font-size: 8pt">
            <tr>
                <td style="width: 20%;">
                    Code
                </td>
                <td style="width: 80%;">
                    Description
                </td>
            </tr>
        </table>
    </HeaderTemplate>
    <ItemTemplate>
        <table style="width: 100%; text-align: left; font-size: 8pt">
            <tr>
                <td style="width: 20%;">
                    <%#DataBinder.Eval(Container.DataItem, "Master_Type_Code")%>
                </td>
                <td style="width: 80%;">
                    <%#DataBinder.Eval(Container.DataItem, "Master_Desc")%>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</telerik:RadComboBox>

Page_Load
radCBOMulti.DataSource = LoadRadTemplate()
 
radCBOMulti.DataBind()


This is the code to load the combo box:
Private Function LoadRadTemplate() As DataTable
 
    Dim dtTemp As New DataTable
    Dim drTemp As DataRow
 
    Dim dcCol1 As New DataColumn("Master_Type_Code", GetType(System.String))
    Dim dcCol2 As New DataColumn("Master_Desc", GetType(System.String))
 
    dtTemp.Columns.Add(dcCol1.ColumnName, dcCol1.DataType)
    dtTemp.Columns.Add(dcCol2.ColumnName, dcCol1.DataType)
 
    drTemp = dtTemp.NewRow
    drTemp.Item(0) = ""
    drTemp.Item(1) = ""
    dtTemp.Rows.Add(drTemp)
 
    drTemp = dtTemp.NewRow
    drTemp.Item(0) = "BR"
    drTemp.Item(1) = "Bedrest BRP"
    dtTemp.Rows.Add(drTemp)
 
    drTemp = dtTemp.NewRow
    drTemp.Item(0) = "CA"
    drTemp.Item(1) = "Cane Required"
    dtTemp.Rows.Add(drTemp)
 
    drTemp = dtTemp.NewRow
    drTemp.Item(0) = "CB"
    drTemp.Item(1) = "Complete Bedrest"
    dtTemp.Rows.Add(drTemp)
 
    drTemp = dtTemp.NewRow
    drTemp.Item(0) = "CR"
    drTemp.Item(1) = "Crutches Required"
    dtTemp.Rows.Add(drTemp)
 
    drTemp = dtTemp.NewRow
    drTemp.Item(0) = "EP"
    drTemp.Item(1) = "Exercises Prescribed - this is a very long description of this service"
    dtTemp.Rows.Add(drTemp)
 
    drTemp = dtTemp.NewRow
    drTemp.Item(0) = "IH"
    drTemp.Item(1) = "Independent at Home"
    dtTemp.Rows.Add(drTemp)
 
    Session("radComboData") = dtTemp
 
    Return dtTemp
 
End Function

Private Sub radCBOMulti_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles radCBOMulti.ItemDataBound
    Try
 
        e.Item.Text = (DirectCast(e.Item.DataItem, DataRowView))("Master_Type_Code").ToString
 
        e.Item.Value = (DirectCast(e.Item.DataItem, DataRowView))("Master_Type_Code").ToString.Trim
 
    Catch objEx As Exception
 
 
    End Try
End Sub







Magdalena
Telerik team
 answered on 19 Jun 2013
6 answers
108 views
Hello

I am using a self referencing radgrid and declare it with

<MasterTableView DataKeyNames="ChildKey, ParentKey" AllowMultiColumnSorting="True" HierarchyLoadMode="Client>
    <SelfHierarchySettings ParentKeyName="ParentKey" KeyName="ChildKey" />
        <Columns>
            ...
            ...
        </Columns>
</MasterTableView>

The problem is that the child keys show up twice -
1) Once as child elements of the parent
2) Second at the same level as parent
> Level
     > Parent1
         > Child1
         > Child2
     > Child1
     > Child2

What am I doing wrong?

Thanks, Raka
Kostadin
Telerik team
 answered on 19 Jun 2013
5 answers
148 views
When is this bug been fixed?
Ivaylo
Telerik team
 answered on 19 Jun 2013
1 answer
103 views

Hello everyone,

I need to use a RadPanelBar in telerik in a way that when it is collapsed it must show a 2-3 details of a person. And when expanded, it shows complete details in its panelbaritem. I am using ItemClick event to read the expand/collapse state and update the header text. But after i implement this event, on every click (to expand/collapse), the whole page flickers. I tried couple of options, but could not avoid it.

Can someone please help? or suggest another control option option?

thanks

Shinu
Top achievements
Rank 2
 answered on 19 Jun 2013
1 answer
693 views
I have a need to set the top and bottom borders for a specific row in a grid. As I can't see how to set just the top and bottom borders, I've tried item.BorderColor, item.BorderWidth, item.BorderStyle and all three show in the generated markup but none actually show on the screen. I'm setting item.Font.Bold also in code behind and this is the only style that is taking effect at the row level.  The styling shows on the screen if I set it on the item cell, but I don't want side borders on the cells.
Is there a way to achieve what I want?
Princy
Top achievements
Rank 2
 answered on 19 Jun 2013
0 answers
53 views
hello,
 Please provide Ajax RadScheduler resource grouping - Client side code samples.
Mohammed
Top achievements
Rank 1
 asked on 19 Jun 2013
1 answer
149 views
Hi,

I have faced a problem in trying to do date-wise sorting in date field in radgrid.It is not happening. Is this feature available? Plz. let us know.

Thanks
Purojit

Princy
Top achievements
Rank 2
 answered on 19 Jun 2013
2 answers
118 views
I have a grid where one column contains a link button. Clicking on this button takes user to a new page.
The grid also has an edit column and an edit form template.
The edit does not fire when clicked.
What do I do to get the edit form to work?
This is the column definition
<MasterTableView CommandItemDisplay="Top" DataKeyNames="Unit_code" AllowMultiColumnSorting="True"
              EditMode="PopUp" InsertItemPageIndexAction="ShowItemOnCurrentPage" HierarchyDefaultExpanded="False">
            
              <Columns>
                  <telerik:GridEditCommandColumn HeaderText="Edit" HeaderStyle-Width="50px" ItemStyle-Width="50px"
                      HeaderStyle-HorizontalAlign="Left" ButtonType="LinkButton" UniqueName="unit_edit">
                  </telerik:GridEditCommandColumn>
                  <telerik:GridButtonColumn UniqueName="ColumnLinkCode" DataTextField="Unit_code"
                      HeaderText="Unit code" ButtonType="LinkButton">
                  </telerik:GridButtonColumn>
                  <telerik:GridBoundColumn HeaderText="Name" HeaderButtonType="TextButton" DataField="Unit_name"
                      UniqueName="Unit_name">
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn HeaderText="Description" HeaderButtonType="TextButton" DataField="unit_description"
                      UniqueName="unit_description">
                  </telerik:GridBoundColumn>
                  <telerik:GridNumericColumn HeaderText="Credits" DecimalDigits="0" DataField="num_credits"
                      UniqueName="num_credits">
                  </telerik:GridNumericColumn>
              </Columns>
 
These are the client settings
<ClientSettings EnablePostBackOnRowClick="false" EnableRowHoverStyle="false">
              <Selecting AllowRowSelect="True" CellSelectionMode="SingleCell" />
               <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true">
              </Scrolling>
          </ClientSettings>
Simon Channell
Top achievements
Rank 1
 answered on 19 Jun 2013
4 answers
305 views

my radgrid had 2 level (use Course_ID as a key to link)

Code as follows:

<telerik:RadGrid ID="RadGrid_TrainingProviderCourse" DataSourceID="LDS_Course" ShowStatusBar="True"
          AutoGenerateColumns="False" AllowSorting="True" runat="server"
          AllowPaging="True" GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
          AllowAutomaticUpdates="True" CellSpacing="0" Width="80%" Skin="Windows7">
          <PagerStyle Mode="NumericPages"></PagerStyle>
          <MasterTableView DataSourceID="LDS_Course" DataKeyNames="Course_ID" AllowMultiColumnSorting="True"
              Width="100%" CommandItemDisplay="Top" Name="Parent"
              AllowAutomaticDeletes="False" AllowAutomaticInserts="False"
              AllowAutomaticUpdates="False">
              <DetailTables>
                  <telerik:GridTableView DataKeyNames="ID"
                      DataSourceID="LDS_TrainingProviderCourse" Width="100%"
                      runat="server" CommandItemDisplay="Top" Name="SubLevel" >
                      <ParentTableRelation>
                          <telerik:GridRelationFields DetailKeyField="Course_ID"
                              MasterKeyField="Course_ID" />
                      </ParentTableRelation>
                      <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                      <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
                      <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
 
                      <Columns>
                          <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn2">
                              <HeaderStyle Width="20px"></HeaderStyle>
                              <ItemStyle CssClass="MyImageButton"></ItemStyle>
                          </telerik:GridEditCommandColumn>
 
                          <telerik:GridBoundColumn SortExpression="Course_Fee_USD" HeaderText="Course_Fee_USD"
                              HeaderButtonType="TextButton" DataField="Course_Fee_USD"
                              UniqueName="Course_Fee_USD"  HeaderStyle-Width="200px"
                              FilterControlAltText="Filter Course_Fee_USD column">                                                              
                              <HeaderStyle Width="200px" />
                          </telerik:GridBoundColumn>                             
                                     
                          <telerik:GridBoundColumn SortExpression="Course_Fee_IDR"
                              HeaderText="Course_Fee_IDR" HeaderButtonType="TextButton"
                              DataField="Course_Fee_IDR" UniqueName="Course_Fee_IDR"
                              HeaderStyle-Width="200px" FilterControlAltText="Filter Course_Fee_IDR column">                                                                                                       
                              <HeaderStyle Width="200px" />
                          </telerik:GridBoundColumn>
 
                          <telerik:GridBoundColumn SortExpression="Course_ID" Visible="false"
                              HeaderText="Course_ID"
                              DataField="Course_ID" UniqueName="Course_ID"
                              HeaderStyle-Width="200px" FilterControlAltText="Filter Course_ID column">                                                                                                                                                                           
                          </telerik:GridBoundColumn>
 
                          <telerik:GridButtonColumn ConfirmText="Delete this record?" ButtonType="ImageButton"
                              CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                              <HeaderStyle Width="20px"></HeaderStyle>
                              <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                          </telerik:GridButtonColumn>
 
                      </Columns>
 
                     <EditFormSettings EditFormType="Template">
                      <EditColumn FilterControlAltText="Filter EditCommandColumn1 column"
                                      UniqueName="EditCommandColumn1">
                       </EditColumn>
                       <FormTemplate>
 
                  <table id="Table2" cellspacing="2" cellpadding="1" width="50%" border="1" rules="none"
                      style="border-collapse: collapse;">
                      <tr class="EditFormHeader">
                      <td style="width:150px">
                      <asp:Label ID="Label5" Text="Training Provider" runat="server"></asp:Label>                                                           
                      </td>
                      <td>
                          <telerik:RadDropDownList ID="rdl_TrainingProvider" runat="server" DataSourceID="LDS_TrainingProvider" DefaultMessage="Please select..."
                           DataValueField="Training_Provider_ID" DataTextField="Internal_Name" >
                          </telerik:RadDropDownList>
                          <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="rdl_TrainingProvider"
                              InitialValue="Please Select..." ErrorMessage="Please select a Training Provider."></asp:RequiredFieldValidator>  
                      </td>
                      </tr>
                      <tr >
                      <td >
                      <asp:Label ID="lb" Text="Course Fee (USD)" runat="server"></asp:Label>                                                           
                      </td>
                      <td>
                      <asp:TextBox ID="tb_Course_Fee_USD" runat="server" Text='<%# Bind("Course_Fee_USD") %>' TabIndex="2"></asp:TextBox>                                                           
                      <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" Display="Dynamic"
                      ErrorMessage="Please, enter valid number." ValidationExpression="^(\d|,)*\.?\d*$" ControlToValidate="tb_Course_Fee_USD">
                      </asp:RegularExpressionValidator>
                      </td>
                      </tr>
                      <tr >
                      <td >
                      <asp:Label ID="Label2" Text="Course Fee (IDR)" runat="server"></asp:Label>                                                           
                      </td>
                      <td>
                      <asp:TextBox ID="tb_Course_Fee_IDR" runat="server" Text='<%# Bind("Course_Fee_IDR") %>' TabIndex="2"></asp:TextBox>                                                           
                      <asp:RegularExpressionValidator ID="RegularExpressionValidator9" runat="server" Display="Dynamic"
                      ErrorMessage="Please, enter valid number." ValidationExpression="^(\d|,)*\.?\d*$" ControlToValidate="tb_Course_Fee_IDR">
                      </asp:RegularExpressionValidator>
                      </td>
                      </tr>
                         <tr>
                          <td align="right" colspan="2">
                              <asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
                                  runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>' >
                              </asp:Button> 
                              <asp:Button ID="btnDelete" Text="Delete" runat="server" CausesValidation="False"
                                  CommandName="Delete"></asp:Button>
                              <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                  CommandName="Cancel"></asp:Button>
 
                          </td>
                      </tr>
 
                              </table>
                          </FormTemplate>
                      </EditFormSettings>
 
                      <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                  </telerik:GridTableView>
              </DetailTables>
 
  <CommandItemSettings ExportToPdfText="Export to PDF" ShowAddNewRecordButton="False"></CommandItemSettings>
  <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
  <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
              <Columns>
                  <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                      <HeaderStyle Width="20px"></HeaderStyle>
                      <ItemStyle CssClass="MyImageButton"></ItemStyle>
                  </telerik:GridEditCommandColumn>
 
                  <telerik:GridBoundColumn DataField="Course_ID"
                      FilterControlAltText="Filter Course_ID column" HeaderButtonType="TextButton"
                      HeaderText="Course_ID" ReadOnly="True" SortExpression="Course_ID" HeaderStyle-Width="200px"
                      UniqueName="Course_ID" Visible="false">
                      <HeaderStyle Width="200px" />
                  </telerik:GridBoundColumn>
 
                  <telerik:GridBoundColumn SortExpression="Course_Name" HeaderText="Course Name" HeaderButtonType="TextButton"
                      DataField="Course_Name" UniqueName="Course_Name"
                      FilterControlAltText="Filter Course_Name column" >
                  </telerik:GridBoundColumn>
 
                  <telerik:GridBoundColumn SortExpression="Course_Name_Ind"
                      HeaderText="Course Name (Ind)" HeaderButtonType="TextButton"
                      DataField="Course_Name_Ind" UniqueName="Course_Name_Ind"
                      HeaderStyle-Width="200px" FilterControlAltText="Filter Course_Name_Ind column">
                      <HeaderStyle Width="200px"></HeaderStyle>
                  </telerik:GridBoundColumn>
 
              </Columns>
 
              <EditFormSettings>
              <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
              </EditFormSettings>
 
              <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                      </MasterTableView>
              <FilterMenu EnableImageSprites="False"></FilterMenu>
                  </telerik:RadGrid>
                   
          <asp:LinqDataSource ID="LDS_Course"
              runat="server" ContextTypeName="dcLRDBDataContext" EntityTypeName=""
              TableName="db_Courses">
          </asp:LinqDataSource>
                  <asp:LinqDataSource ID="LDS_TrainingProviderCourse"
              runat="server" ContextTypeName="dcLRDBDataContext" EntityTypeName=""
              TableName="db_Training_Providers_Course_Lists"
              Where="Course_ID == @Course_ID">
                      <WhereParameters>
                          <asp:Parameter Name="Course_ID" Type="Int32" />
                      </WhereParameters>
          </asp:LinqDataSource>

How can I get the Course_ID from master/parent when perform insert ?

my code behind:

Protected Sub RadGrid_TrainingProviderCourse_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid_TrainingProviderCourse.ItemCommand
    RadGrid_TrainingProviderCourse.MasterTableView.ClearEditItems()
 
 
 
    If e.CommandName = RadGrid.InitInsertCommandName Then   'Click Add New Record button           
        Dim editColumn As GridEditCommandColumn = CType(RadGrid_TrainingProviderCourse.MasterTableView.GetColumn("EditCommandColumn"), GridEditCommandColumn)
        editColumn.Visible = False
    ElseIf (e.CommandName = RadGrid.RebindGridCommandName AndAlso e.Item.OwnerTableView.IsItemInserted) Then
        e.Canceled = True
    Else
        Dim editColumn As GridEditCommandColumn = CType(RadGrid_TrainingProviderCourse.MasterTableView.GetColumn("EditCommandColumn"), GridEditCommandColumn)
        If Not editColumn.Visible Then  'Click Cancel button (both Insert and Update mode)
            editColumn.Visible = True
        End If
 
        Dim ddlTrainingProvider As RadDropDownList = DirectCast(e.Item.FindControl("rdl_TrainingProvider"), RadDropDownList)
        Dim txt_Course_Fee_USD As TextBox = DirectCast(e.Item.FindControl("tb_Course_Fee_USD"), TextBox)
        Dim txt_Course_Fee_IDR As TextBox = DirectCast(e.Item.FindControl("tb_Course_Fee_IDR"), TextBox)
        Dim dc As New dcLRDBDataContext
 
        If e.CommandName = "PerformInsert" Then
 
            Dim newRecord1 As New db_Training_Providers_Course_List
            dc.db_Training_Providers_Course_Lists.InsertOnSubmit(newRecord1)
 
            If ddlTrainingProvider.SelectedValue <> ddlTrainingProvider.DefaultMessage Then
                newRecord1.Training_Provider_ID = ddlTrainingProvider.SelectedValue
            End If
           
            newRecord1.Course_Fee_USD = txt_Course_Fee_USD.Text
            newRecord1.Course_Fee_IDR = txt_Course_Fee_IDR.Text
            newRecord1.LastUpdateDate = DateTime.Now
            newRecord1.LastUpdateBy = HttpContext.Current.Session("UserID")
            dc.SubmitChanges()
 
            RadGrid_TrainingProviderCourse.MasterTableView.ClearEditItems()
            RadGrid_TrainingProviderCourse.DataBind()
 
        ElseIf e.CommandName = "Update" Then
            Dim lid As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ID")
 
            Dim rec = (From p In dc.db_Training_Providers_Course_Lists Where p.ID = lid).FirstOrDefault
            If Not rec Is Nothing Then
                If ddlTrainingProvider.SelectedValue <> ddlTrainingProvider.DefaultMessage Then
                    rec.Training_Provider_ID = ddlTrainingProvider.SelectedValue
                End If
                rec.Course_Fee_USD = txt_Course_Fee_USD.Text
                rec.Course_Fee_IDR = txt_Course_Fee_IDR.Text
                rec.LastUpdateBy = HttpContext.Current.Session("UserID")
                rec.LastUpdateDate = DateTime.Now
                dc.SubmitChanges()
            End If
 
            RadGrid_TrainingProviderCourse.MasterTableView.ClearEditItems()
            RadGrid_TrainingProviderCourse.DataBind()
        ElseIf e.CommandName = "Delete" Then
            Dim lid As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ID")
            Dim rec2 = (From p In dc.db_Training_Providers_Course_Lists Where p.ID = lid).FirstOrDefault
            If Not IsNothing(rec2) Then
                dc.db_Training_Providers_Course_Lists.DeleteOnSubmit(rec2)
                dc.SubmitChanges()
            End If
 
            RadGrid_TrainingProviderCourse.MasterTableView.ClearEditItems()
            RadGrid_TrainingProviderCourse.DataBind()
        End If
 
        dc.Dispose()
    End If
End Sub

Thanks

Joe
Top achievements
Rank 1
 answered on 19 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?