Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
501 views
Hi there,
 
First post on this forum :)

My question relates to placing a radgrid inside a GridTemplateColumn within a RadGrid, I'm not sure how to do it.  Currently i have a radgrid as per below:

 <telerik:RadGrid id="rgdListLicences" runat="server" Width="100%"  GridLines="None" Skin="eLicensing_paging"  EnableEmbeddedSkins="false" EnableViewState="true">
                     <MasterTableView RetrieveAllDataFields="false" AutoGenerateColumns="false" >
                        <Columns>
                            <telerik:GridBoundColumn DataField="clientRef" HeaderText="Client Ref">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="commencementDate" HeaderText="Commencement Date">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn UniqueName="validations" HeaderText="Validations" SortExpression="CompanyName" InitializeTemplatesFirst="false">
                                <ItemTemplate>
                                    <telerik:radgrid ID="rgdValidations"  runat="server" >
                                        <MasterTableView >
                                            <Columns >
                                                <telerik:GridBoundColumn DataField="validations.Text">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                        </MasterTableView>
                                    </telerik:radgrid>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>

                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>


And I Bind to the radgrid in the codebehind, as follows:

rgdListLicences.DataSource = CType(licenceImportParser.getLicences.Licence.ToList, IEnumerable)
rgdListLicences.DataBind()


The Datasource licenceImportParser.getLicences.Licence, is a list of objects.  These objects contain several properties, which bind successfully to the other columns (ie. commencement date above), but also contain a list of Strings called validations which i need to bind to the radgrid inside the GridTemplateColumn.

I thought i could just set the DataField="validations.Text"  or something like that considering validations is a list of Strings.. but not sure here!


But I cant figure out how i can bind it!  Any help is greatly appreciated!!

Thanks
Neil
Manish
Top achievements
Rank 2
 answered on 17 Jun 2020
2 answers
265 views
Hello,
in an ASP.NET WebForms applications, written in VB, could someone provide me 
a simple example for populate a 

telerik:RadComboBox

getting the values from one only column (States) from a table in a SQL Server database? 

No where conditions, just only the distinct States from a single table. 

Thank you in advance. 

Luis
Luis
Top achievements
Rank 1
Veteran
 answered on 17 Jun 2020
2 answers
4.1K+ views
Good day,
please am using a radcombobox that allows for multiple selection.
My problem is how can i insert the selected items into a database one by one.
Can someone please help me
thank you
Doncho
Telerik team
 answered on 17 Jun 2020
1 answer
142 views

Hello,

I am new in telerik radgrid, working in c#. I am working in a radgrid which have AllowFilteringByColumn feature. I am binding this grid from code behind every time. This grid have 2 extra CheckBox column. Problem is when I am performing any search page load is called and  the checked check box disappears after page load. How can I Resolve this problem. I need to keep the previous selection of the check box after performing search on preferred column.

 

<telerik:RadGrid ID="grdAgreement" runat="server" SelectedItemStyle-CssClass="SelectedStyle"
                                    HeaderStyle-Height="40px" HeaderStyle-BackColor="#CEECF5" AutoGenerateColumns="False"
                                    GroupPanelPosition="Top" ResolvedRenderMode="Classic" Skin="Simple" Width="100%"
                                    ShowStatusBar="True" AllowMultiRowSelection="True" AllowFilteringByColumn="true"
                                    HeaderStyle-Font-Size="18px" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Names="Arial Regular">
                                    <MasterTableView DataKeyNames="Id" >
                                        <Columns>                                            
                                            <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" FilterControlAltText="Filter Id column"
                                                HeaderText="ID" ReadOnly="True" SortExpression="Id" UniqueName="Id" Visible="true" AllowFiltering="false">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="DocumentTitle" FilterControlAltText="Filter DocumentTitle column"
                                                HeaderText="Document Title" SortExpression="DocumentTitle" UniqueName="DocumentTitle" AllowFiltering="true"
                                                AndCurrentFilterFunction="Contains" AutoPostBackOnFilter="True" AllowSorting="True"
                                                HeaderStyle-Font-Size="18px" FilterControlWidth="120px">
                                                <HeaderStyle Width="200px" HorizontalAlign="Center" />
                                            </telerik:GridBoundColumn>                                           
                                            <telerik:GridTemplateColumn HeaderText="Select for Template" AllowFiltering="false">
                                                 <ItemTemplate>
                                                          <asp:CheckBox ID="chkSelectForTemplate" Checked='<%# Eval("SelectforTemp") %>' runat="server" />
                                                 </ItemTemplate>
                                            </telerik:GridTemplateColumn> 
                                        </Columns>
                                    </MasterTableView>
                                    <HeaderStyle BackColor="#CEECF5" Height="40px"></HeaderStyle>
                                    <SelectedItemStyle CssClass="SelectedStyle"></SelectedItemStyle>
                                </telerik:RadGrid>

 

code behind

if (!IsPostBack)
        {
            if (Request.QueryString["ID"] != null)
            {
                string str_id = Request.QueryString["ID"].ToString();
                if (str_id != "")
                {
                    // code for select by ID
                    BindingGrid(str_id);
                }
            }
            else
            {
                BindingGrid();
            }           
        }
        else
        {            
        }

Attila Antal
Telerik team
 answered on 17 Jun 2020
1 answer
123 views

Hello All,

I'm trying to calculate a percentage in a GridCalculatedColumn, but both input types are integer, so the return value is incorrect (an int formatted as %, which results in 0%, 100% 200% etc.)

Is it possible to cast the value in the expression, or do I have to do it the hard way using itemdatabound or similar?

markup:
<telerik:GridCalculatedColumn DataFields="totalNo,UsedNo" HeaderText="Allocated" DataType="System.Decimal"
Expression="({0} / {1})" ColumnGroupName="Compute" DataFormatString="{0:P}" />

I tried "(Convert.ToDecimal({0}) .... but that gave me errors.

Thx in advance!
M.

Attila Antal
Telerik team
 answered on 17 Jun 2020
1 answer
220 views

Hello,

Is there any reason why Chrome browsers adds this odd border on focus? 

So far, I noticed that it happens with TextBox and RadGrid but possibly it happens with other controls too. 

When you inspect elements in Chrome there is no such style

 

Thank you

 

Doncho
Telerik team
 answered on 17 Jun 2020
5 answers
963 views
I want to be able to change the cell of "Name" to Color.Firebrick if column "Active" is false. I can't seem to be able to change it. I attempted to place the information inside of my sub that takes in GridCommandEventArgs. It looks like this:


Protected Sub myGrid_ShowInactivity(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles myGrid.ItemCommand
            If TypeOf e.Item Is GridDataItem Then
                Dim item As GridDataItem = e.Item
                If item("Active").Text = "false" Then
                    item("Name").Text = item("Name").Text + " INACTIVE"
                    item("Name").BackColor = Color.Firebrick
                    item("Name").ForeColor = Color.White
                End If
            End If
End Sub


For some reason this is not doing anything.

Do I have to put this inside a different sub? If so, what sub would that be?

I also get an error when I attempt any other action, so it seems that this is not the place I should put this code in.
Eyup
Telerik team
 answered on 17 Jun 2020
5 answers
2.3K+ views
Hi,

I Created radgrid with the column name "Project Health" ( Unique name is "ProjectHealth"). I can edit this column on popup. Once popup opens they can select text Green or Red or Yellow. (using radcombo box). What i want is when user select the yellow, the text color in the grid should display in yellow and same for both red and green. How to do it. how to do this??
Eyup
Telerik team
 answered on 17 Jun 2020
1 answer
122 views

Hi!

Radgrid is populated from Database in code behind using "NeedDataSource" event.

CombBox provides the filter for the RadGrid (also get's it's data from the RadGrid's "NeedDataSource" event).

With Viewstate enabled everything works fine.

Question is how can I still filter when Viewstate is disabled on the Grid?

 

Thanks in advance for your help!

Tom

Eyup
Telerik team
 answered on 17 Jun 2020
2 answers
114 views

How to change Some columns in RadGant to ReadOnly ="true"

Colums  Default

and Colums GanttCustomField

 

bassam
Top achievements
Rank 1
Veteran
 answered on 16 Jun 2020
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
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
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?