Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
94 views
Hi Guru's
I am working on the RadGrid control & stuck at a point where I want to basically do the following operation:

I have a button named "Update"
then a radgrid

The requirement is as follow: The user visits the site on load of the page he will see the grid with the selected items that he had selected in his last visit... we have these values from the database,

Now when he selects the new row I have a table in the database named : "userselected" I want that his userID should be added in the list with this new itemno that he has selected..

I am using entity framework to communicate to the database.

thanks in advance
SPTECH
Tsvetoslav
Telerik team
 answered on 05 Jul 2011
2 answers
176 views
<telerik:RadMaskedTextBox ID="PostalCode" runat="server" Text='<%#Bind("PostalCode")%>'
                                  Mask="L#L #L#"  OnTextChanged="PostalCode_OnTextChanged" AutoPostBack="true" Width="50" />
I'm having trouble with the ontextchanged event of the radmaskedtextbox. I enter my postal code into the mask and tab to the next field. It posts back and calls the ontextchanged event. However, the first time is posts back, the text value is blank "". If i enter the postal code a second time, the ontextchanged event picks up the value. It seems it needs a postback to actually change the value in the page, but the ontextchanged event runs before the value has been changed. Is there a workaround for this behaviour?
Maria Ilieva
Telerik team
 answered on 05 Jul 2011
3 answers
57 views

I'm using a tabstrip control with 3 tabs.

- tab 1 is static content - works fine

- tab 2 is a RadGrid  (data loads fine, paging is fine, details all fine, however commanditem export doesnt work.
    - note i put the same grid in a page by itself (no tabs) and export work just fine.

- tab 3 is a form of user fields with a submit button (in buttonclick event, data is saved to sql db). When debugging form seems to work fine. i can set a break point on ButtonClick and it gets called everytime and data is properly saved. When the page is put on production server buttonClick event doesnt seem to fire. I put the exact same code outside the tabcontrol and it work perfect on production server and debug. buttonclick always fires.

I'm using whatever the newest version of rad controls is, as of this post.

thoughts?

jason
Dimitar Terziev
Telerik team
 answered on 05 Jul 2011
4 answers
164 views
Hello Everyone...

I have a problem Binding ComboBoxes. Here is my example:-
I have a table in my database which has a list of company vehicles. Another table has a complete list of any vehicles ID, vehicleMake, vehicleModel, vehicleEngineSize.

In edit mode the company vehicles can be changed colour etc. Also there are three comboboxes. 1: List all the possible Makes. Ford, Volvo etc. The second all Models and the final one all engine sizes.

So that the user is only able to select the correct combination the boxes load by EnableLoadOnDemand. I used the Telerik help file here: Help File

Ok so my problem comes when I want to update any possible changes.

THIS WORKES:-
<
telerik:GridTemplateColumn  DataField="vehicleModel" HeaderText="vehicleModel"
     SortExpression="vehicleModel" UniqueName="vehicleModel">
     <EditItemTemplate>
         <telerik:RadComboBox ID="rcb_vehicleModel" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"vehicleModel")%>' EnableLoadOnDemand="True" OnItemsRequested="rcb_vehicleModel_ItemsRequested" AutoPostBack="true">
         </telerik:RadComboBox>                          
 
     </EditItemTemplate>
     <ItemTemplate>
         <asp:Label ID="lbl_vehicleModel" runat="server" Text='<%# Eval("vehicleModel") %>'></asp:Label>
     </ItemTemplate>
     <HeaderStyle Width="6em" />
 </telerik:GridTemplateColumn>


DOES NOT WORK:-
<
telerik:GridTemplateColumn DataField="vehicleModel"  HeaderText="vehicleModel"
    SortExpression="vehicleModel" UniqueName="vehicleModel">
    <EditItemTemplate>
        <telerik:RadComboBox ID="rcb_vehicleModel" runat="server" DataSourceID="sqlds_vehicleModel" DataTextField="vehicleModel"
            DataValueField="vehicleMake" SelectedValue="<%# bind('vehicleModel') %>" AutoPostBack="True">
        </telerik:RadComboBox>
    </EditItemTemplate>
    <ItemTemplate>
        <asp:Label ID="lbl_vehicleModel" runat="server" Text='<%# Eval("vehicleModel") %>'></asp:Label>
    </ItemTemplate>
    <HeaderStyle Width="6em" />
</telerik:GridTemplateColumn>

As you can see in the first example there is no SelectedValue="<%# bind('vehicleModel') %>" in the above template. If I include this i get the error:-

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control

But without the Bind the changes obviously are not returned to the table

Protected Sub rcb_vehicleModel_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
 
     Dim editedItem As GridEditableItem = CType(CType(sender, RadComboBox).NamingContainer, GridEditableItem)
 
     Dim ddl_make As RadComboBox = DirectCast(editedItem.FindControl("rcb_vehicleMake"), RadComboBox)
     Dim ddl_model As RadComboBox = DirectCast(editedItem.FindControl("rcb_vehicleModel"), RadComboBox)
     Dim ddl_vehicleEngine As RadComboBox = DirectCast(editedItem.FindControl("rcb_vehicleEngineSize"), RadComboBox)
 
 
     Dim SQLstr As String
     SQLstr = "SELECT DISTINCT vehicleModel FROM dbo.vehicleTypes WHERE (vehicleMake = '" & ddl_make.SelectedValue.ToString & "')"
 
     ' change the data source for ContactTitle with custom code here
 
     sqlds_vehicleModel.SelectCommand = SQLstr
 
     ddl_model.DataValueField = "vehicleModel"
     ddl_model.DataTextField = "vehicleModel"
 
     ddl_model.DataSource = sqlds_vehicleModel
     ddl_model.DataBind() '********@ERROR HERE AS ABOVE: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control
 
 End Sub

My question therefore is how do I rebind the changes back to the database. I think the error above is because I am calling the Bind to early but I'm not sure... Hopefully someone will have the answer as this problem is driving me mad!!!

Thanx for looking. Marcus

PS Can any code suggestions be in VB pls

Marcus
Top achievements
Rank 1
 answered on 05 Jul 2011
1 answer
146 views
Hi,

I am using RadPanelbar as menu item in my app. The PanelBar is getting created dynamically from the database. I would like to differentiate parent and child menu items. The following is what I would like to do. Please let me how I can get this functionality.

1)    User should not be able to click on the Parent item.
2)    Add 2 different icons to Parent and Child menu items.

The following is my code.


Public Sub BindPanelBar(ByVal ds As DataSet)
        RadPanelBar1.DataTextField = "description"
        RadPanelBar1.DataNavigateUrlField = ""
        RadPanelBar1.DataFieldID = "id"
        RadPanelBar1.DataFieldParentID = "PARENT_ID"
        RadPanelBar1.DataValueField = "Code"
        RadPanelBar1.DataSource = ds
        RadPanelBar1.DataBind()

End Sub

Protected Sub RadPanelBar1_ItemDataBound(ByVal sender As Object, ByVal e As RadPanelBarEventArgs) Handles RadPanelBar1.ItemDataBound
        Dim row As DataRowView = DirectCast(e.Item.DataItem, DataRowView)
        e.Item.Enabled = [Boolean].Parse(row("enable_status").ToString())
        e.Item.Expanded = True
        e.Item.ToolTip = e.Item.Text
 
End Sub


Thank you,
Dimitar Terziev
Telerik team
 answered on 05 Jul 2011
2 answers
72 views
Hi,

I am using Telerik.Web.UI.dll 2008.02.1001.20 version of Telerik ASP.NET AJAX and finding some strange issues with only on IE 8 browser on local machine where applicaiton is deployed on both Windows 7 and Windows 2008 machine. It does not happen if the site is accessed remotely from other machines in IE 8. The examples of issues are, with RadCombobox reducing the width during AJAX call or chaning the selection. Or RadGrid disappears during AJAX refresh or when RadToolTip is displayed in AJAX. The below are the different environments tried. 

  • In IIS 7.5, run applicaiton pool under Integrated mode and classic modes.
  • Windows 7 and Windows 2008 servers
  • specifing localhost or machinename in the url

In above different senarios, some combination resolves some issues and other combination solves other issues. But I could not figure out any one setting which resolves all these Telerik issues. (BTW, I only get these issues with telerik controls when tried with IE 8 in local machines.) As said before everything works fine when the site is accessed remotely from other machines through IE 8.

Can you please provide any workaround to solve this issue? There is no option to upgrade the telerik control to later version for me due to project schedule. also as it is working fine remotely, it seems that there are some issues with IE 8 and telerik control only in local machine.

I truly appreciate your help to resolve this issue. thanks in advance!

 

Sub
Top achievements
Rank 1
 answered on 05 Jul 2011
3 answers
90 views
Dear Team

i tried almost all the ways which i could find on internet but still unable to get the updated values from bound grid column.

plz check out my code lines.


aspx coding


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="frmViewUnitMaster.aspx.vb" Inherits="iTourism.WebForm1" %>
  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server" >
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
      
        <table style="width:100%;">
            <tr>
                <td>
                     </td>
                <td>
                    <asp:Button ID="btnAdd" runat="server" Text="Add" Width="69px" />
                    <asp:Label ID="lblMessage" runat="server" Text="Label"></asp:Label>
                </td>
                <td>
                     </td>
            </tr>
            <tr>
                <td>
                     </td>
                <td>
  
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                        <AjaxSettings>
                            <telerik:AjaxSetting AjaxControlID="UMGrid">
                                <UpdatedControls>
                                    <telerik:AjaxUpdatedControl ControlID="UMGrid" />
                                </UpdatedControls>
                            </telerik:AjaxSetting>
                        </AjaxSettings>
  
  
  
                    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="UMGrid" runat="server" AutoGenerateColumns="False" GridLines="None"
                        AllowFilteringByColumn="True" AllowSorting="True" AutoGenerateEditColumn="True"
                        AllowPaging="True" Width="60%" ViewStateMode="Enabled" CellPadding="10"
                        CellSpacing="10" onupdatecommand="UMGrid_UpdateCommand" >
  
  
  
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True"  />
            <Selecting AllowRowSelect="True"></Selecting>
              
        </ClientSettings>
  
  
  
<MasterTableView EditMode="EditForms" DataKeyNames="UnitCode">
  
    <Columns>
      
        <telerik:GridBoundColumn DefaultInsertValue="" UniqueName="UnitCode"
            HeaderText="UnitCode" DataField="UnitCode" ReadOnly="True">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DefaultInsertValue="" UniqueName="UnitDesc"
            HeaderText ="Unit Description" DataField="Description" >
        </telerik:GridBoundColumn>
  
          
          
    </Columns>
  
    <EditFormSettings  EditFormType="AutoGenerated"  >
  
              
          
    </EditFormSettings>
  
  
</MasterTableView>
  
  
  
    </telerik:RadGrid>
                </td>
                <td>
                     </td>
            </tr>
             
        </table>
      
    </div>
    </form>
</body>
</html>


Vb Code

Imports System
Imports System.Data
Imports Telerik.Web.UI
Imports System.Data.SqlClient
  
  
Public Class WebForm1
    Inherits System.Web.UI.Page
  
    Dim objclsUnitMaster As New clsUnitMaster
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
        UMGrid.AutoGenerateDeleteColumn = True
        UMGrid.AutoGenerateEditColumn = True
        UMGrid.DataSource = (objclsUnitMaster.GetUnitCodeList).Tables("UnitMaster")
        UMGrid.DataBind()
    End Sub
  
    Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click
        Response.Redirect("frmUnitMaster.aspx")
    End Sub
  
 
  
    Private Sub UMGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles UMGrid.ItemCommand
          
  
        If (e.CommandName = RadGrid.UpdateCommandName) Then
            
            Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
              
            Dim newValues As New Hashtable
            e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)
   'not getting the updated value        
            lblMessage.Text = newValues("Description").ToString
        End If
   
  
         
    End Sub
  
      
  
    Private Sub UMGrid_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles UMGrid.NeedDataSource
        UMGrid.DataSource = (objclsUnitMaster.GetUnitCodeList).Tables("UnitMaster")
        UMGrid.DataBind()
    End Sub
  
  
    Public Sub UMGrid_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles UMGrid.UpdateCommand
  
        ' Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
        'Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
  
  
        Dim _UnitCode As Integer = 0
        Dim _Description As String = ""
        Dim _Result As Long = 0
  
        Dim _item As GridEditableItem
        _item = e.Item
  
        Try
 
             _UnitCode = Convert.ToInt32(DirectCast(_item("UnitCode").Controls(0), TextBox).Text)
 'Unable to Get Updated Value using this also
            _Description = DirectCast(_item("Description").Controls(0), TextBox).Text
  
  
            _Result = objclsUnitMaster.UpdateUnitByCode(_UnitCode, _Description)
  
            If _Result = 0 Then
                lblMessage.Text = "Record Saved Successfully"
            Else
                lblMessage.Text = "Error While Saving Record" & " - " & _Result
            End If
  
            'UMGrid.Rebind()
        Catch ex As Exception
  
            lblMessage.Text = ex.Message
  
        End Try
  
  
  
  
    End Sub
End Class



Mubasshar
Top achievements
Rank 1
 answered on 05 Jul 2011
2 answers
192 views
Hello,

I'm trying to open a popup window (file.aspx?BillID=X) from a grid when i click the preview button but i'm not able too (i don't want to open a RadWindow)

any hint?

  <telerik:RadGrid ID="DataGrid" runat="server" ClientSettings-AllowColumnsReorder="true" ClientSettings-ReorderColumnsOnClient="true" AllowPaging="True" ShowFooter="True" HorizontalAlign="NotSet" PageSize="100" Width="100%" BorderWidth="0px" FilterItemStyle-HorizontalAlign="Center"  HeaderStyle-HorizontalAlign="Center" FilterItemStyle-VerticalAlign="middle" AllowSorting="True"  AllowFilteringByColumn="true">
<MasterTableView Dir="RTL" AutoGenerateColumns="False" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowMultiColumnSorting="true" ClientDataKeyNames="BillID" DataKeyNames="BillID" CommandItemDisplay="Top">
<HeaderStyle HorizontalAlign="Center" />
<FilterItemStyle HorizontalAlign="Center" />
 <NoRecordsTemplate>No Records Found.</NoRecordsTemplate>
 <CommandItemTemplate>
 <table id="headertable" runat="server" align="center">
<tr>
<td>
<asp:ImageButton ID="btnAdd" CommandName="Insert" ImageUrl="~/Styles/images/button_Client.jpg"
    runat="server" CausesValidation="false" Style="cursor: hand" AlternateText="Insert New Loan" />
 </td>
 </tr>
 </table>
 </CommandItemTemplate>
 <Columns>
 <telerik:GridButtonColumn UniqueName="Edit" CommandName="Edit" ButtonType="ImageButton" ImageUrl="~/Styles/images/icon_edit.gif" Text="تعديل" HeaderText="تعديل">
<HeaderStyle Width="35px" HorizontalAlign="center" />
</telerik:GridButtonColumn>
<telerik:GridButtonColumn   UniqueName="Preview" CommandName="Preview" ButtonType="ImageButton"  ImageUrl="~/Styles/images/icon_preview.gif" Text="فاتورة" HeaderText="فاتورة">
<HeaderStyle Width="35px" HorizontalAlign="center" />
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="BillID" Visible="False" HeaderText="BillID" ReadOnly="True"  SortExpression="BillID" UniqueName="BillID" />
<telerik:GridBoundColumn DataField="BillNumber" Visible="true" HeaderText="الرقم"
ReadOnly="True" SortExpression="BillNumber" UniqueName="BillNumber" />
<telerik:GridBoundColumn DataField="BillFile" Visible="true" HeaderText="الملف" ReadOnly="True"
SortExpression="BillFile" UniqueName="BillFile" />
<telerik:GridBoundColumn DataField="ClientName" Visible="true" HeaderText="اسم الزبون"
ReadOnly="True" SortExpression="ClientName" UniqueName="ClientName" />
<telerik:GridBoundColumn DataField="ClientCode" Visible="true" HeaderText="رمز الزبون"
ReadOnly="True" SortExpression="ClientCode" UniqueName="ClientCode" />
<telerik:GridBoundColumn DataField="Weight" Visible="true" HeaderText="الوزن كلغ"
ReadOnly="True" SortExpression="Weight" UniqueName="Weight" />
<telerik:GridBoundColumn DataField="BillValue" Visible="true" HeaderText="القيمة"
ReadOnly="True" SortExpression="BillValue" UniqueName="BillValue" />
<telerik:GridBoundColumn DataField="ClosingDate" Visible="true" HeaderText="تاريخ إغلاق الفاتورة"
   ReadOnly="True" SortExpression="ClosingDate" UniqueName="ClosingDate" />
<telerik:GridBoundColumn DataField="ReleaseDate" Visible="true" HeaderText="السنة"  ReadOnly="True" SortExpression="ReleaseDate" UniqueName="ReleaseDate" />
</Columns>
<ExpandCollapseColumn ButtonType="ImageButton" UniqueName="ExpandColumn" Visible="False">
<HeaderStyle Width="19px" />
</ExpandCollapseColumn>
<PagerStyle Mode="NextPrevNumericAndAdvanced" PageButtonCount="20" />
 </MasterTableView>
<GroupPanel>
<PanelItemsStyle CellSpacing="2" />
</GroupPanel>
<ClientSettings AllowColumnsReorder="True" EnableRowHoverStyle="true">
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>

Thanks
Mike_T
Top achievements
Rank 1
 answered on 05 Jul 2011
2 answers
84 views
Hi,
Is there to cause a certain appointment to open in the Advanced Form onPageLoad?  Either with the codebehind or with javascript will work. If nothing else, Is there a way to simulate a click on an appointment in the collection?

Thanks,
Dan
Dan Lehmann
Top achievements
Rank 1
 answered on 05 Jul 2011
1 answer
112 views
I setup a header aggregate in a grouping but it seems to be coming up with the wrong sum total.  Screenshot attached.

Very strange that the footer aggregates come up with the right total, but the header doesn't.  Below is how I'm setting up the structure of the grid columns.

Private Sub BuildDataGrid(ByVal view As Views)
    Try
        Dim addColumn As Action(Of GridColumn) =
            Sub(column) BottomSection(Of TMGrid)("dgView").MasterTableView.Columns.Add(column)
 
        Dim addToGrouping As Action(Of GridColumn) =
            Sub(column)
                BottomSection(Of TMGrid)("dgView").MasterTableView.GroupByExpressions.Add(
                    New GridGroupByExpression(column)
                )
            End Sub
 
        With BottomSection(Of TMGrid)("dgView")
            .MasterTableView.Columns.Clear()
            .MasterTableView.GroupByExpressions.Clear()
 
            Select Case view
                Case Views.Daily
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "tl_date",
                        Function() "Date",
                        Function() False,
                        Function() "{0:MMMM d}",
                        Sub(column)
                            Dim grouping As New GridGroupByExpression()
 
                            Dim selectDate As New GridGroupByField()
                            selectDate.FieldName = "tl_date"
                            selectDate.FieldAlias = "tl_date"
                            selectDate.FormatString = TMGrid.SHORT_DATE_FORMAT
                            selectDate.HeaderText = "DATE"
                            selectDate.HeaderValueSeparator = ": "
 
                            Dim selectTotalHours As New GridGroupByField()
                            selectTotalHours.FieldName = "te_hours"
                            selectTotalHours.FieldAlias = "te_hours"
                            selectTotalHours.HeaderText = "TOTAL HOURS"
                            selectTotalHours.Aggregate = GridAggregateFunction.Sum
                            selectTotalHours.FormatString = TMGrid.HOURS
                            selectTotalHours.HeaderValueSeparator = ": "
 
                            Dim groupByDate As New GridGroupByField()
                            groupByDate.FieldName = "tl_date"
                            groupByDate.FieldAlias = "tl_date"
 
                            grouping.SelectFields.Add(selectDate)
                            grouping.SelectFields.Add(selectTotalHours)
                            grouping.GroupByFields.Add(groupByDate)
 
                            'grouping.Expression = "tl_date [Date], Sum(te_hours) TotalHours [Total Hours] Group By tl_date"
                            BottomSection(Of TMGrid)("dgView").MasterTableView.GroupByExpressions.Add(grouping)
                        End Sub
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "tc_name",
                        Function() "ACTIVITY",
                        AddressOf RequireSubactivity,
                        Nothing,
                        addToGrouping
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "tsc_name",
                        Function() "SUBACTIVITY"
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "te_desc",
                        Function() "DESCRIPTION"
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "te_hours",
                        Function() "HOURS",
                        Function() True,
                        Function() "<a href='{0}'>{0:#0.00}</a>",
                        Sub(column)
                            column.ItemStyle.HorizontalAlign = HorizontalAlign.Right
                            column.HeaderStyle.HorizontalAlign = HorizontalAlign.Right
                            column.FooterStyle.HorizontalAlign = HorizontalAlign.Right
                            column.Aggregate = GridAggregateFunction.Sum
                            column.FooterAggregateFormatString = "Total: {0:#0.00}"
                        End Sub
                    )
                Case Views.Monthly
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "tl_monthname",
                        Function() "Month",
                        Function() False,
                        Nothing,
                        addToGrouping
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "tc_name",
                        Function() "ACTIVITY",
                        AddressOf RequireSubactivity,
                        Nothing,
                        addToGrouping
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "tsc_name",
                        Function() "SUBACTIVITY"
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "te_desc",
                        Function() "DESCRIPTION"
                    )
                    If (Convert.ToInt32(ViewState("ReportingMode")) = TMTERMSOptions.TMTERMSReportingModes.Daily) Then
                        TMGrid.AddBoundColumn(
                            addColumn,
                            Function() "te_hours",
                            Function() "HOURS",
                            Function() True,
                            Function() "{0:#0.00}",
                            Sub(column)
                                column.ItemStyle.HorizontalAlign = HorizontalAlign.Right
                                column.HeaderStyle.HorizontalAlign = HorizontalAlign.Right
                                column.FooterStyle.HorizontalAlign = HorizontalAlign.Right
                                column.Aggregate = GridAggregateFunction.Sum
                                column.FooterAggregateFormatString = "Total: {0:#0.00}"
                            End Sub
                        )
                    Else
                        TMGrid.AddBoundColumn(
                            addColumn,
                            Function() "te_hours",
                            Function() "HOURS",
                            Function() True,
                            Function() "<a href='{0}'>{0:#0.00}</a>",
                            Sub(column)
                                column.ItemStyle.HorizontalAlign = HorizontalAlign.Right
                                column.HeaderStyle.HorizontalAlign = HorizontalAlign.Right
                                column.FooterStyle.HorizontalAlign = HorizontalAlign.Right
                                column.Aggregate = GridAggregateFunction.Sum
                                column.FooterAggregateFormatString = "Total: {0:#0.00}"
                            End Sub
                        )
                    End If
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "certified_message",
                        Function() "CERTIFICATION"
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "approved_message",
                        Function() "APPROVAL"
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "te_approved_hours",
                        Function() "APPROVED HOURS",
                        Function() "{0:#,##0.00}"
                    )
                Case Views.Annual
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "tl_year",
                        Function() "YEAR",
                        Function() False,
                        Nothing,
                        addToGrouping
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "tc_name",
                        Function() "YEAR / ACTIVITY",
                        AddressOf RequireSubactivity,
                        Nothing,
                        addToGrouping
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "tsc_name",
                        Function() "YEAR / ACTIVITY / SUBACTIVITY"
                    )
                    TMGrid.AddBoundColumn(
                        addColumn,
                        Function() "te_hours",
                        Function() "HOURS",
                        Function() "{0:#,##0.00}"
                    )
            End Select
        End With
    Catch ex As Exception
        Throw New Exception("BuildDataGrid procedure failed", ex)
    End Try
End Sub
Mira
Telerik team
 answered on 05 Jul 2011
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?