Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
675 views
Hi,

I have a GridTemplateColumn on a RadGrid.  This Template contains a Label control for ItemTemplate and a DropDownList for the EditItemTemplate.  The label is bound to a field from the DataTable.  Now, When the Grid row goes into Edit mode, I need to set the selectedindex of the dropdown to show the original value from the label.  How and where would I do that?  I don't seem to have access to the Label control from within the ItemDataBound event for the GridEditableItem.  Somebody please help.

Babu.

Here is my Markup:

                    <telerik:GridTemplateColumn DataField="role" HeaderText="Role" UniqueName="Role">  
                        <EditItemTemplate> 
                            <asp:DropDownList ID="ddlRoles" runat="server" DataTextField="Role" DataValueField="Role" 
                                Width="125px">  
                            </asp:DropDownList> 
                        </EditItemTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblRole" runat="server" Text='<%# Bind("role") %>'></asp:Label> 
                        </ItemTemplate> 
                        <ItemStyle Wrap="False" /> 
                    </telerik:GridTemplateColumn> 
 

And here is my code:

    protected void rgUserAdmin_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if (e.Item.ItemType == GridItemType.EditItem)  
        {  
            GridEditableItem edtItem = (GridEditableItem)e.Item;  
              
            DropDownList ddl = (DropDownList)edtItem.FindControl("ddlRoles");  
            if (null != ddl)  
            {  
                ddl.DataSource = ForecastUtils.GetAllMetricUserRoles();  
                ddl.DataTextField = "role";  
                ddl.DataValueField = "role";  
 
                // this is where I need to set the value of this ddl to the value  
                // from the Label on the ItemTemplate.  
                ddl.SelectedIndex = -1;  
                ddl.DataBind();  
            }  
        }  
    } 
Llewellen
Top achievements
Rank 1
 answered on 16 Sep 2016
1 answer
97 views
I am looking for a way to make the tokens in an AutoCompleteBox be links.  You click on a token to open up a page with more information.  The simplest way would be if the "Entry" had a URL property that could be set but that does not exist.  I will request this as a feature, but are there any suggestions?
Ivan Danchev
Telerik team
 answered on 16 Sep 2016
18 answers
402 views
Hi,

We are trying to convert a site from a competitor's chart to Telerik, but are having problems with the legend spacing and sizing.  We are looking for the following:

1) Legend color box to be larger
2) Left-aligned legend vertically aligned to top
2) Legend vertical spacing between items to be larger
3) Not a biggie, but Legend Color box with border

Are these items possible?  Legend Margin seems to only work left and right, and Legend Padding seems to have no effect.

Thank you,
David A.
Stamo Gochev
Telerik team
 answered on 16 Sep 2016
5 answers
117 views

What would be a good approach to allow for rich content editing for each slide, basically want to have a dynamic amount of slides depending on images in a folder that will be a background image for the slide. Then each slide needs to have a layer of rich content that can be edited per slide.

 

Can i create slides (server side) per images in folder and inside the slide dynamically create a radeditor that has the image as background and store the content in my database and make sure i pause the slide on mouseover (when editor is in edit mode) to allow for editing. or is there any better approach to this? anyone done something similar?

 

Christian

RJ
Top achievements
Rank 1
 answered on 15 Sep 2016
2 answers
104 views

Hi,

I am using Rotator to display banner images in the home page. I need to enable reponsive design for the various dimensions of the mobile devices.

I have fixed the width to 100%, however for various screen size, the rotator does not seem to adjust.

Please advise how to solve this issue

 

 

RJ
Top achievements
Rank 1
 answered on 15 Sep 2016
7 answers
1.6K+ views
Hi,

I've been searching the forum for an answer to this question for days and it appears that no one has covered it before. I'm using InPlaceEdit mode for my RadGrid control. When I put it into edit mode, the size of the text fields that show up stretch the page I'm using quite a bit.

Question: Is there a way to customize the width of the textboxes that appear in the RadGrid edit mode's inplace edit mode?
Sabaratnam
Top achievements
Rank 1
 answered on 15 Sep 2016
2 answers
142 views

Hi,

I noticed in my web application that I was unable to select a .csv file to upload using the AsyncUpload control when using the MS Edge browser.

I initially though that it must have been excluded by the AllowedFileExtensions property, however found that it was working using Chrome.

I am not on the latest version of the RadControls but experienced the exact same issue on the demo site below

http://demos.telerik.com/aspnet-ajax/asyncupload/examples/draganddrop/defaultcs.aspx

I do have the anniversary update of Windows 10 installed and am wondering if it is related.

My version of Edge is as follows

Edge 38.14393.0.0

EdgeHTML 14.14393

 

Thanks,

Matt

Rumen
Telerik team
 answered on 15 Sep 2016
9 answers
1.1K+ views
Hi,
I am novice to telerik and getting some problem in radcombobox. my scenario is:
- A RadPanelBar
- A RadPanelItem inside the RadPanelBar
- In ItemTemplate of RadPanelItem, I have a RadGrid having columns for Institution, Grade, Degree.
- Inside RadGrid, I've a FormTemplate in which i've place text fields for Institution and Grade and a RadComboBox for Degree (MBA, BBA, etc. fetching from DB).
- My DB design is as I've a Candidate table in which there is a column for Degree (of number type, a foriegn key for my Degrees table).
- I want to show in my RadGrid the Institution, Grade, and Degree_Name (MBA, BBA, etc.), But i cannot understand how to achieve this.
- Another problem is that I am unable to use the selectedValue of RadComboBox.

Please refer to my code snippet.

 

<telerik:RadPanelItem runat="server" Text="Step 5: Qualification >>>">
  
<Items>
  
<telerik:RadPanelItem runat="server" Value="QualificationItem">
  
<ItemTemplate>
  
<div id="QualificationDetail" class="CVPanelGrid" >
  
<telerik:RadGrid ID="QualificationGrid" runat="server" AutoGenerateColumns="False" 
  
CellSpacing="0" GridLines="None" Skin="Web20" 
  
ondeletecommand="QualificationGrid_DeleteCommand" 
  
oninsertcommand="QualificationGrid_InsertCommand" 
  
onneeddatasource="QualificationGrid_NeedDataSource" 
  
onprerender="QualificationGrid_PreRender" 
  
onupdatecommand="QualificationGrid_UpdateCommand" 
  
onitemdatabound="QualificationGrid_ItemDataBound">
  
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
  
</HeaderContextMenu>
  
  
<MasterTableView CommandItemDisplay="Top" EditMode="PopUp" EditFormSettings-EditColumn-CancelImageUrl="images/CancelRecord.gif" EditFormSettings-EditColumn-InsertImageUrl="images/InsertRecord.gif" EditFormSettings-EditColumn-ButtonType="ImageButton" DataKeyNames="PKEY" AllowAutomaticInserts="False">
  
  
<CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="Add Qualification" ShowAddNewRecordButton="true" ShowRefreshButton="false" >
  
  
</CommandItemSettings>
  
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
  
<HeaderStyle Width="20px" />
  
</RowIndicatorColumn>
  
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
  
<HeaderStyle Width="20px" />
  
</ExpandCollapseColumn>
  
  
<Columns>
  
<telerik:GridBoundColumn FilterControlAltText="Filter PKey column" 
  
UniqueName="PKey" DataField="PKEY" HeaderText="PKey" HeaderStyle-Width="250" Visible="false">
  
<HeaderStyle HorizontalAlign="Center" /> 
  
</telerik:GridBoundColumn>
  
  
<telerik:GridBoundColumn FilterControlAltText="Filter Institute column" 
  
UniqueName="Institute" DataField="INSTITUTION" HeaderText="Institute" HeaderStyle-Width="250">
  
<HeaderStyle HorizontalAlign="Center" /> 
  
</telerik:GridBoundColumn>
  
  
<telerik:GridBoundColumn FilterControlAltText="Filter Degree column" 
  
UniqueName="Degree" DataField="NAME" HeaderText="Degree" HeaderStyle-Width="150">
  
<HeaderStyle HorizontalAlign="Center" /> 
  
</telerik:GridBoundColumn>
  
  
<telerik:GridBoundColumn FilterControlAltText="Filter CompletionYear column" DataFormatString ="{0:yyyy}" 
  
UniqueName="CompletionYear" DataField="COMPLETION_YEAR" HeaderText="Year of Completion" HeaderStyle-Width="100">
  
<HeaderStyle HorizontalAlign="Center" /> 
  
</telerik:GridBoundColumn>
  
  
<telerik:GridBoundColumn FilterControlAltText="Filter Major column" 
  
UniqueName="Major" DataField="MAJOR" HeaderText="Major" HeaderStyle-Width="150">
  
<HeaderStyle HorizontalAlign="Center" /> 
  
</telerik:GridBoundColumn>
  
  
<telerik:GridBoundColumn FilterControlAltText="Filter Grade column" 
  
UniqueName="Grade" DataField="GRADE" HeaderText="Grade" HeaderStyle-Width="150">
  
<HeaderStyle HorizontalAlign="Center" /> 
  
</telerik:GridBoundColumn>
  
  
<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" HeaderStyle-Width="15px">
  
<HeaderStyle Width="15px" />
  
<ItemStyle HorizontalAlign="Center" />
  
</telerik:GridEditCommandColumn>
  
<telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="ImageButton" CommandName="Delete" HeaderStyle-Width="15px">
  
<HeaderStyle Width="15px" />
  
<ItemStyle HorizontalAlign="Center" /> 
  
</telerik:GridButtonColumn>
  
</Columns>
  
<EditFormSettings CaptionFormatString="Qualification Details" PopUpSettings-Modal="true" EditFormType="Template" PopUpSettings-Width="480px" >
  
<FormTemplate>
  
<div id="QualificationForm" >
  
<ul ID="QualificationInfo" class="formModalList">
  
<li>
  
<asp:Label ID="Label24" runat="server" CssClass="CVtextLabel" Text="Institution:" 
  
Width="120px"></asp:Label>
  
<asp:TextBox ID="txtInstitute" Text= '<%# Bind("INSTITUTION") %>' runat="server" CssClass="CVtextInput"></asp:TextBox
  
</li>
  
<li>
  
<asp:Label ID="Label25" runat="server" CssClass="CVtextLabel" 
  
Text="Degree:" Width="120px"></asp:Label>
  
<telerik:RadComboBox ID="cmbDegree" runat="server" Skin="Web20"
  
</telerik:RadComboBox
  
</li>
  
<li>
  
<asp:Label ID="Label26" runat="server" CssClass="CVtextLabel" 
  
Text="Year of Completion:" Width="120px"></asp:Label>
  
<telerik:RadMonthYearPicker ID="txtCompletionYear" Runat="server"
  
Culture="English (United States)" EnableTyping="False" Skin="Web20" 
  
DbSelectedDate='<%# Bind ("COMPLETION_YEAR") %>'>
  
<DatePopupButton HoverImageUrl="" ImageUrl=""
  
ToolTip="Open the year view popup." />
  
<DateInput DateFormat="yyyy" DisplayDateFormat="yyyy" ReadOnly="True" runat="server">
  
</DateInput>
  
</telerik:RadMonthYearPicker>
  
</li>
  
  
<li>
  
<asp:Label ID="Label20" runat="server" CssClass="CVtextLabel" Text="Major:" 
  
Width="120px"></asp:Label>
  
<asp:TextBox ID="txtMajor" Text= '<%# Bind("MAJOR") %>' runat="server" CssClass="CVtextInput"></asp:TextBox>
  
</li>
  
  
<li>
  
<asp:Label ID="Label22" runat="server" CssClass="CVtextLabel" Text="Grade:" 
  
Width="120px"></asp:Label>
  
<asp:TextBox ID="txtGrade" Text= '<%# Bind("GRADE") %>' runat="server" CssClass="CVtextInput"></asp:TextBox>
  
</li>
  
  
<li class="lastListItem"
  
<telerik:RadButton ID="BtnAddQualification" runat="server" Text='<%# IIf (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>'
  
Skin="Web20" Width="50px" CssClass="btnInsertItem" 
  
CommandName='<%# IIf (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'>
  
</telerik:RadButton
  
<telerik:RadButton ID="BtnCancelQualification" runat="server" Text="Cancel"
  
Skin="Web20" Width="50px" CssClass="btnCancelItem" CommandName="Cancel" 
  
>
  
</telerik:RadButton>
  
</li>
  
</ul>
  
</div>
  
</FormTemplate>
  
  
  
<FormTableButtonRowStyle HorizontalAlign="Right" /> 
  
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
  
  
</EditColumn>
  
<PopUpSettings Modal="True" Width="480px" />
  
</EditFormSettings>
  
</MasterTableView>
  
<FilterMenu EnableImageSprites="False">
  
</FilterMenu>
  
  
  
  
</telerik:RadGrid>
  
<br /> 
  
</div>
  
</ItemTemplate>
  
</telerik:RadPanelItem>
  
</Items>
  
</telerik:RadPanelItem>

Here you can see that I've not bind my cmbDegree combobox with the DB. I am performing this task in code.

 

 

 

Protected Sub QualificationGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
        If TypeOf e.Item Is GridEditFormItem And e.Item.IsInEditMode Then
            Dim editedItem As GridEditFormItem = CType(e.Item, GridEditFormItem)
            Dim cmbDegree As RadComboBox = editedItem.FindControl("cmbDegree")
  
            Dim srv As New PICT.Web.Services.Careers.CareersClient
            Dim dSet As Global.PICT.Web.CVDataSet = srv.GetDegrees()
  
            cmbDegree.DataSource = dSet.Degree
            cmbDegree.DataTextField = "NAME"
            cmbDegree.DataValueField = "PKEY"
            cmbDegree.DataBind()
        End If
    End Sub

The above code sets the data source of cmbDegree and correctly shows when i add new record in the grid through Pop-up modal box. But when i hit insert button, the selected value of combo box not saved in my datatable and not reflect in my grid. (Remember i want to show the Degree Name in the grid, not the selectedvalue of combo.)

Kindly help me out in this matter.

Regards,
Ovais

Majoy
Top achievements
Rank 1
 answered on 15 Sep 2016
1 answer
36 views
There are 15 different downloads available and no description. Fortunately I have a Virtual so I can go through the tedious process of downloading, installing & reverting back to my snapshot. But this is entirely unnecessary and would save your support team and your customers consider time just to add a short description.
Yana
Telerik team
 answered on 15 Sep 2016
1 answer
75 views

Does anyone know how to get a Weighted Average Aggregate out of the PivotGrid?

 

Thanks,

 

Erik

Maria Ilieva
Telerik team
 answered on 15 Sep 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?