Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
656 views

I have a RadGrid. In the RadGrid I have some GridTemplateColumns. In the EditItemTemplate I have a RadDropDownList. The GridTemplateColumn has a DataField defined. My expectation is that when the page loads that the RadDropDownList in the EditItemTemplate should have a SelectedValue that matches the DataField. But the SelectedValue is the default (blank) first item in the dropdown list.  As soon as I select something from the dropdown list everything is happy including the Label that is in the ItemTemplate shows the text value for the item I selected from the dropdown list. 

It works if I use a GridDropDownColumn instead, but I cannot in this case as I need to trigger javascript stuff based on an item selected from the dropdown. 

 

How do I make sure that when the page loads the dropdown list's selected value matches the column's DataField value?  It seems it should work this way automatically.

 

<telerik:RadGrid ID="grdAddresses" runat="server" AutoGenerateColumns="false" DataKeyNames="Uid"
        OnNeedDataSource="grdAddresses_NeedDataSource"
        OnBatchEditCommand="grdAddresses_BatchEditCommand"
        OnPreRender="grdAddresses_PreRender"
        EnableViewState="true"
        AllowSorting="false"
        AllowPaging="false" >
      <MasterTableView EditMode="Batch" BatchEditingSettings-EditType="Row">
        <Columns>
          <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" UniqueName="DeleteColumn"
              ImageUrl="~/Images/clear-button-24x24.png"
              HeaderStyle-Width="4%" ></telerik:GridButtonColumn>
          <telerik:GridTemplateColumn HeaderText="Type*" DataField="TypeUid" UniqueName="Type" >
            <ItemTemplate>
              <asp:Label runat="server" />
            </ItemTemplate>
            <EditItemTemplate>
              <telerik:RadDropDownList ID="ddlType" runat="server" DataTextField="DropDownListText" DataValueField="Uid" DataFied="TypeUid" >
              </telerik:RadDropDownList>
            </EditItemTemplate>
          </telerik:GridTemplateColumn>
          <telerik:GridBoundColumn HeaderText="Address*" DataField="Address" />
          <telerik:GridBoundColumn HeaderText="Supplemental Address" DataField="AddressSupplemental" />
          <telerik:GridBoundColumn HeaderText="City/Locality" DataField="LocalityName" />
          <telerik:GridTemplateColumn HeaderText="Country" DataField="CountryUid" UniqueName="Country" >
            <ItemTemplate>
              <asp:Label runat="server" Text='<%# Eval("CountryUid") %>' />
            </ItemTemplate>
            <EditItemTemplate>
              <telerik:RadDropDownList ID="ddlCountry" runat="server"
                  DataTextField="DropDownListText" DataValueField="Uid" OnClientSelectedIndexChanged="countrySelectedIndexChanged" >
              </telerik:RadDropDownList>
            </EditItemTemplate>
          </telerik:GridTemplateColumn>
          <telerik:GridTemplateColumn HeaderText="State" DataField="StateUid" UniqueName="State" >
            <ItemTemplate>
              <asp:Label runat="server" Text='<%# Eval("StateUid") %>' />
            </ItemTemplate>
            <EditItemTemplate>
              <telerik:RadDropDownList ID="ddlState" runat="server" OnClientItemsRequesting="stateItemsRequesting"
                  OnClientSelectedIndexChanged="stateSelectedIndexChanged" >
              </telerik:RadDropDownList>
            </EditItemTemplate>
          </telerik:GridTemplateColumn>
          <telerik:GridBoundColumn HeaderText="Postal Code" DataField="PostalCode" />
          <telerik:GridTemplateColumn HeaderText="County" DataField="CountyUid" UniqueName="County" >
            <ItemTemplate>
              <asp:Label runat="server" Text='<%# Eval("CountyUid") %>' />
            </ItemTemplate>
            <EditItemTemplate>
              <telerik:RadDropDownList ID="ddlCounty" runat="server" OnClientItemsRequesting="countyItemsRequesting" >
              </telerik:RadDropDownList>
            </EditItemTemplate>
          </telerik:GridTemplateColumn>
        </Columns>
      </MasterTableView>
    </telerik:RadGrid>

 

Eyup
Telerik team
 answered on 16 Sep 2016
1 answer
108 views

Hi,

I have just moved ComponentArt to Telerik so please pardon my ignorance.

I am trying to have a radgrid inside a panelbar item and was just wondering if its possible to load the radgrid only when the panelbar item is expanded/clicked?

I do not want to bring it from server unless the user clicks the panelbar item.

Can you please show me an example which achieves this effect?

Thank you

Anton
Telerik team
 answered on 16 Sep 2016
1 answer
113 views

Hi,

We have a RadSearchBox that get populated using DataTable. We also have a RadListview on the same page. Our requirement is when data is loaded into Search dropdown, if the data is already in RadListview, that value should appear as BOLD in search drop down. Attached is an example. If Alabama Power is in the search box it should appear as bold.

Can anyone please help me with that.

 

Ivan Danchev
Telerik team
 answered on 16 Sep 2016
6 answers
731 views
When I try to use the ExcelML format I always get an empty spreadsheet.  If I run the code with ExportToCSV instead of ExportToExcel, I get data, or if I just leave out the GridExcelExportFormat.ExcelML line (use the default format) with ExportToExcel I also get a spreadsheet.  Any ideas why I'm getting a blank spreadsheet when I use both the ExcelML format and ExportToExcel method?

 

Me.RTLGrid1.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML

 

 

Me.RTLGrid1.ExportSettings.ExportOnlyData = True

 

 

Me.RTLGrid1.ExportSettings.OpenInNewWindow = True

 

 

Me.RTLGrid1.MasterTableView.ExportToExcel()

 

 

'Me.RTLGrid1.MasterTableView.ExportToCSV()

 

Konstantin Dikov
Telerik team
 answered on 16 Sep 2016
10 answers
690 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
109 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
423 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
133 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
111 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?