Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
215 views
I am converting an app to RadGrid controls, and I would like advice on the best way to convert some code that I had running in a DataGrid's RowDataBound event:
Private Sub gvAvailableTasks_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvAvailableTasks.RowDataBound
 
        If Not gvAvailableTasks.SelectedRow Is Nothing Then
            If gvAvailableTasks.SelectedRow.ID = e.Row.ID Then
                Exit Sub
            End If
        End If
 
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim dd As DateTime
            dd = CType(e.Row.Cells(6).Text, DateTime)
 
            If dd < Date.Now Then
                e.Row.Cells(6).BackColor = Drawing.Color.Red
            Else
 
                If DateDiff(DateInterval.Hour, Date.Now, dd) < 5 Then
                    e.Row.Cells(6).BackColor = Drawing.Color.Orange
                ElseIf DateDiff(DateInterval.Hour, Date.Now, dd) < 9 Then
                    e.Row.Cells(6).BackColor = Drawing.Color.Yellow
                End If
            End If
 
            ' Alert message
 
            Dim s As String = e.Row.Cells(5).Text
 
            If s.Trim <> " " And s.Trim <> "" Then
                e.Row.Cells(5).BackColor = Drawing.Color.Yellow
            End If
 
        End If
    End Sub

Basically the code changes the color of the due date to let the user know what is late. The last bit changes the background color if an alert message exists.

Thanks for your help!
David
Top achievements
Rank 1
 answered on 22 Apr 2013
3 answers
241 views
Hello,
In my code in Radgrid_Init I am declaring detailTables by:

                    GridTableView tableViewLevel = new GridTableView(Radgrid);
                    tableViewLevel.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand;
                    tableViewLevel.AutoGenerateColumns = false;

                    Radgrid.MasterTableView.DetailTables.Add(tableViewLevel);

so I can open DetailTables (I have image in first column).

Then on Radgrid_DetailTableDataBind I'm clearing data by:

            Radgrid.MasterTableView.DetailTables.Clear();

and again declaring:

            GridTableView tableViewLevel = new GridTableView(Radgrid);
            tableViewLevel.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand;
            tableViewLevel.AutoGenerateColumns = false;

and then declaring some columns headers for my detailTable and adding them:

            Radgrid.MasterTableView.DetailTables.Add(tableViewLevel);

after that I have some operations to get table from SQL and I'm setting dataSource by:

                e.DetailTableView.DataSource = table;

I think this should work, however I'm getting empty DetailTables in the view. When I set property AutoGenerateColumns to true data appers.

Any idea what I'm doing wrong?

I should add that I want to dynamically set columns in Radgrid_DetailTableDataBind, because there are more than 1 Detailtable linked to 1 row in Mastertable. In Radgrid_DetailTableDataBind i'm checking which one was selected (in tooltip linked to expand/collapse imapge) and setting the right sql table. When every detailtable was declared in Radgrid_Init there was several request to Radgrid_DetailTableDataBind and Grid was working slow.
Elliott
Top achievements
Rank 2
 answered on 22 Apr 2013
0 answers
71 views
Hi,

I would like to have this:
One grid that shows search results. On clientClick it opens, under row, user control that will be filled with current data for selected row. User can make changes, save .... It should all be on a client and comunicate via web services.

Is there any example for that?
Petar
Top achievements
Rank 1
 asked on 22 Apr 2013
2 answers
86 views
Hi all,
          we have recently upgraded one of our product from version 2008 to version 2012 to use cdn feature of radscript manager and radstylesheetmanager. Its working fine except the layout of the page is quite different. What is the correct approach to make it look exactly the same ? Thanks.

Regards
Kris
Top achievements
Rank 1
 answered on 22 Apr 2013
1 answer
123 views
Dear Telerik Technical Team,

I'm using the OrgChart control to display organization chart. Furthermore, I used toolstip to mouse-over objects to view more information of each object. 

I would like to enquire if OrgChart control is able to display the relationship (i.e. boss of, brother of, sibling of) along the "line/arrrow" which links between the entities? Thank you. 

Best Regards
William 
Plamen
Telerik team
 answered on 22 Apr 2013
5 answers
253 views
I'm using a Rad Scheduler. Setting the datasource through programming. In the appointment template I've defined 5 labels. For each day the appointment template would carry these 5 labels. However there will be difference in the data it carries and the formatting of the labels too will be different for different criteria. I'm able to get/set the data, but not able to do the formatting.
Given below is the aspx syntax.

 


 

<telerik:RadScheduler ID="RadScheduler2" runat="server" DataEndField="DutyEnd"   
 
DataKeyField="Id" DataStartField="DutyStart" CustomAttributeNames="HoursPerDay" 
 
DataSubjectField="Date"   
 
onappointmentcommand="RadScheduler2_AppointmentCommand"   
 
onappointmentdatabound="RadScheduler2_AppointmentDataBound"   
 
onformcreated="RadScheduler2_FormCreated">  
 
<AppointmentTemplate> 
 
<asp:Label Text='<%# Bind("HoursPerDay") %>' runat="server" ID="lblTest"></asp:Label><br /> 
 
<asp:Label Text="This is a test2" runat="server" ID="Label8"></asp:Label><br /> 
 
<asp:Label Text="This is a test3" runat="server" ID="Label9"></asp:Label><br /> 
 
<asp:Label Text="This is a test4" runat="server" ID="Label10"></asp:Label><br /> 
 
<asp:Label Text="This is a test5" runat="server" ID="Label11"></asp:Label><br /> 
 
</AppointmentTemplate> 
 
</telerik:RadScheduler> 
 
 

On code behind I'm able to set the value as shown below. 

 

protected void RadScheduler2_AppointmentDataBound(object sender, SchedulerEventArgs e)  
        {  
e.Appointment.Attributes["HoursPerDay"] = "Value from DB";  
} 

However In addition to this I would like to do formatting on the labels based on certain criteria. For example for the label "lblTest" need to set the font color to Red, set the visible property of the label to "true/false", etc............. Basically I need a way to find out the control within the appointment template.

I'm unable to do this. Appreciate if some one could let me know how to achieve this (please provide with some code sample)

Thank you.

Plamen
Telerik team
 answered on 22 Apr 2013
3 answers
163 views

I've tried everything, can't seem to get the value of a EditItemTemplate that holds a radComboBox.  I have my grid setup like this:

<telerik:RadGrid ID="RadGrid1" GridLines="Both" AutoGenerateColumns="False"
                                    AllowPaging="True" AllowSorting="True" runat="server" OnItemDataBound="OnItemDataBoundHandler"
                                    OnInsertCommand="RadGrid1_InsertCommand" OnItemCreated="RadGrid1_ItemCreated"
                                    DataSourceID="DeliverableDataSource" AllowAutomaticUpdates="False" AllowAutomaticInserts="False" AllowAutomaticDeletes="false"
                                    ShowStatusBar="True" CellSpacing="0" OnUpdateCommand="RadGrid1_UpdateCommand" OnDeleteCommand="RadGrid1_DeleteCommand" Width="900px">
                                    <MasterTableView ShowFooter="false" EditMode="InPlace" CommandItemDisplay="Top">
                                        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

                                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

                                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="DeliverableID" DataType="System.Int32" Visible="false" FilterControlAltText="Filter DeliverableID column" HeaderText="DeliverableID" ReadOnly="True" SortExpression="DeliverableID" UniqueName="DeliverableID">
                                            </telerik:GridBoundColumn>

                                            <telerik:GridTemplateColumn HeaderText="Deliverable Type" HeaderStyle-Font-Bold="true" ItemStyle-Width="240px">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "DeliverableType")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadComboBox runat="server" EnableLoadOnDemand="true" ID="cmbType" DataTextField="DeliverableTypeDesc"
                                                        DataValueField="DeliverableTypeDesc" DataSourceID="DeliverableTypeDataSource" SelectedValue='<%#Bind("DeliverableType") %>'>
                                                    </telerik:RadComboBox>
                                                </EditItemTemplate>
                                                <HeaderStyle Font-Bold="True" />
                                                <ItemStyle Width="140px" />
                                            </telerik:GridTemplateColumn>

                                            <telerik:GridTemplateColumn HeaderText="Deliverable User" ItemStyle-Width="240px" HeaderStyle-Font-Bold="true">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "DeliverableUser")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadComboBox runat="server" ID="cmbUser" DataTextField="UserName" SelectedValue='<%#Bind("DeliverableUser") %>'
                                                        DataValueField="UserName" DataSourceID="UserDataSource">
                                                    </telerik:RadComboBox>
                                                </EditItemTemplate>
                                                <HeaderStyle Font-Bold="True" />
                                                <ItemStyle Width="140px" />
                                            </telerik:GridTemplateColumn>

                                            <telerik:GridTemplateColumn DataField="Verdict" HeaderText="Verdict" HeaderStyle-Font-Bold="true" UniqueName="Verdict">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "Verdict")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadComboBox runat="server" ID="cmbVerdict" SelectedValue='<%#Bind("Verdict") %>'>
                                                        <Items>
                                                            <telerik:RadComboBoxItem Text=" " Value=" " />
                                                            <telerik:RadComboBoxItem Text="Accepted" Value="Accepted" />
                                                            <telerik:RadComboBoxItem Text="Rejected" Value="Rejected" />
                                                        </Items>
                                                    </telerik:RadComboBox>
                                                </EditItemTemplate>
                                                <HeaderStyle Font-Bold="True" />
                                                <ItemStyle Width="100px" />
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridEditCommandColumn FooterText="EditCommand footer" UniqueName="EditCommandColumn" ButtonType="ImageButton" EditImageUrl="~/Images/DeviationEdit.png"
                                                HeaderText="" HeaderStyle-Width="80px" UpdateText="Save" UpdateImageUrl="~/Images/DeviationSave.jpg" CancelImageUrl="~/Images/DeviationCancel.jpg" InsertImageUrl="~/Images/DeviationSave.jpg">
                                                <HeaderStyle Width="50px" />
                                            </telerik:GridEditCommandColumn>
                                            <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ImageUrl="~/Images/DeviationDelete.jpg" ButtonType="ImageButton" UniqueName="deleteColumn">
                                                <HeaderStyle Width="30px"></HeaderStyle>
                                            </telerik:GridButtonColumn>

                                        </Columns>

                                        <EditFormSettings>
                                            <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
                                        </EditFormSettings>
                                    </MasterTableView>

                                    <FilterMenu EnableImageSprites="False"></FilterMenu>
                                </telerik:RadGrid>




I want to hit a button that is not part of the radGrid, and from code behind, I want to get the selected Value from the cmbVerdict column for every row in the grid.  Something like this:

            foreach (GridDataItem item in RadGrid1.Items)
            {                               
                RadComboBox cmbV = (RadComboBox)item.FindControl("cmbVerdict");
                ....
            }
This always return null.  I've tried 7000 different combinations from the hundreds of posts.  Nothing seems to work.  Please help.

Jayesh Goyani
Top achievements
Rank 2
 answered on 22 Apr 2013
6 answers
174 views
In compatibility view enable my grid css are not adjusting .Please check the following attachment.
JJ
Top achievements
Rank 1
 answered on 22 Apr 2013
8 answers
516 views
HI there.

Is there any way that I can disable the alert that appears when navigation to a date using the top navigation arrows that is before the mindate value that I have set?

Your help would be greatly appreciated!!

Danielle
Arno
Top achievements
Rank 2
 answered on 22 Apr 2013
1 answer
77 views
Hello,

I have a simple page with one RadUpload control. I have set up the skin to Office2007.
The problem appears when I use IE8 or IE9 - the skin/css is broken and the RadUpload has two textboxes and two button (also the dot of the list element is visible). My telerik version is Q3 2011.
IE10 is fine.

I read the existing threads for the same issue and I tried all different suggestions but without any success.
I added <telerik:RadStyleSheetManager runat="server" ID="RadStyleSheetManager1"> </telerik:RadStyleSheetManager>--%> but nothing has changed.

Please find attached an image showing the issue!

Could you help me to solve it, please?


Thanks in advance!



Plamen
Telerik team
 answered on 22 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?