Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
4.4K+ 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
185 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
182 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
305 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
1.0K+ 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.5K+ 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
176 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
158 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
3 answers
637 views

Is there a way to determine the parent radwindow of a rad button contained in a contenttemplate in client-side javascript?

e.g. if I have two radwindows, each with a radbutton, and each radbutton calls a common OnClientClicking event, is there a way to determine the parent window from the button object in the common code?

 

<telerik:radWindow runat="server" ID="radwindow1">
 <contenttemplate>
  <telerik:radbutton id="radbutton1" runat="server" onclientclicking="CommonFunction" />
 </contenttemplate>
</telerik:radwindow>
<telerik:radWindow runat="server" ID="radwindow2">
 <contenttemplate>
  <telerik:radbutton id="radbutton2" runat="server" onclientclicking="CommonFunction" />
 </contenttemplate>
</telerik:radwindow>
 
<script>
function CommonFunction(button, eventArgs) {
 var radWindow = ...how to determine which radwindow from the button element? ...
}
</script>
Vessy
Telerik team
 answered on 16 Jun 2020
14 answers
1.5K+ views
Hi,

I suppose to create a grid template column in code behind with dropdown in edit item template and label in item template as usual. I'm new telerik.. Plz help me...
Rumen
Telerik team
 answered on 16 Jun 2020
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?