Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
225 views
hi.

I have a grid like this with GridCalculatedColumn DataType="System.TimeSpan".
Now I want to Calculate The Total Time.
Can Any one help me how to calculate the Total Time With GridCalculatedColumn .



<telerik:RadGrid ID="MReportRGrid" runat="server" AllowFilteringByColumn="True" AllowPaging="True" 
                        GridLines="None" PageSize="20" ShowGroupPanel="True" Skin="Sunset" Style="position: static" 
                        Visible="False" AutoGenerateColumns="False" ShowFooter="true"
                        <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true"
                            <Columns> 
                                <telerik:GridBoundColumn Aggregate="Count" DataField="Account" HeaderText="Account" 
                                    UniqueName="Account" FooterText="Total Files:"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="ProviderName" HeaderText="Provider Name" UniqueName="ProviderName"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="location" HeaderText="Location" UniqueName="location"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="sublocation" HeaderText="Sub Location" UniqueName="sublocation"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="BatchTime" HeaderText="Batch Time" UniqueName="BatchTime"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="serialno" HeaderText="Serial #" UniqueName="serialno"
                                </telerik:GridBoundColumn> 
                              
                                <telerik:GridCalculatedColumn DataFields="playlength" HeaderText="Play Length" UniqueName="playlength" 
                                    DataType="System.TimeSpan" FooterText="Total Play Length:" Aggregate="sum"
                                </telerik:GridCalculatedColumn> 
                            </Columns> 
                            <GroupByExpressions> 
                                <telerik:GridGroupByExpression> 
                                    <SelectFields> 
                                        <telerik:GridGroupByField FieldAlias="ProviderName" FieldName="ProviderName" FormatString="{0:D}" 
                                            HeaderValueSeparator=" From: " HeaderText="Provider Name" /> 
                                             
                                    </SelectFields> 
                                    <GroupByFields> 
                                        <telerik:GridGroupByField FieldAlias="ProviderName" FieldName="ProviderName" SortOrder="Descending" 
                                            FormatString="{0:D}" HeaderText="Provider Name" /> 
                                    </GroupByFields>                                     
                                </telerik:GridGroupByExpression> 
                            </GroupByExpressions> 
                            <RowIndicatorColumn> 
                                <HeaderStyle HorizontalAlign="Center" /> 
                                <ItemStyle HorizontalAlign="Center" /> 
                            </RowIndicatorColumn> 
                        </MasterTableView> 
                        <ClientSettings AllowDragToGroup="True"
                        </ClientSettings> 
                    </telerik:RadGrid> 

Thank You
Suresh K

Suresh K
Top achievements
Rank 1
 answered on 10 Nov 2009
2 answers
139 views
Hello,

I use a RadGrid2, inside it's master table  I have a NestedViewTemplate with a RadTabStrip inside I have a RadGrid2. control. So, my question is how I create referancing to  RadGrid2. I would like to set some column properties.create

Thanks for your effort answer me
Z.Rusev
Zlatko Rusev
Top achievements
Rank 1
 answered on 10 Nov 2009
2 answers
114 views
Hi,

I am using Telerik.Web.UI dll -2009 version. I am not using separate skin folders for various controls. So i dont have css files at all for the rad  controls. Now i Need to change the background color of the contentArea to white. Is it possible to achieve this without adding a separate css file to the application ? (i could able to do this with follg code).
                       <telerik:RadEditor Width="650px"  Skin="Default" ID="radAboutUs" Style="margin-left: 20px;
                        margin-top: 3px; padding-left: 5px;" runat="server">
                        <CssFiles>
                            <telerik:EditorCssFile Value="~/EditorContentArea.css" />
                        </CssFiles>
                    </telerik:RadEditor>

Thanks,
Jeevitha




Shinu
Top achievements
Rank 2
 answered on 10 Nov 2009
2 answers
132 views
Hi,

I need to determine if all the nodes in my treeview are checked or not.  My treeview filters an assosciated list on the page.

The application is a document management system.  It returns documents of many types, the user can then filter the type based on a tree structure on the left-hand side.  The point being that if all nodes are checked, then there is no need to filter the list of documents.

The only way I can see is to traverse the whole tree strucuture, keeping a count as I go.  Not the neatest solution I think?

Thanks.
Andrew Currie
Top achievements
Rank 1
 answered on 10 Nov 2009
1 answer
114 views
Just when I thought I had really started to make some cool things with your controls, you guys have to go and release Q3.  Wow, just looking over the What's New pages make me drool.

I have to personally thank you for building exporting into the grid control.  THANK YOU!  Saves me so much time.
Paul
Telerik team
 answered on 10 Nov 2009
2 answers
102 views
I just finished upgrading our codebase to the Q3 2009 build for ASP.NET Ajax controls.

I have a RadControlBox inside a Web User Control.

The Web User Control is used inside a RadPanelBar.

When the page loads, the RadControlBox is loaded with my items, but is disabled.  I tried explicity setting the Enabled property to True, but this doesn't work either.

If I move the Web User control outside of the Panel Bar, it works fine.  If I move the RadControlBox from the Web User Control to a Rad Panel, it works fine.

So the problem has something to do with a RadControlBox inside a Web User Control that is used in Panel Item.

This was working fine before the Q3 upgrade.

Thoughts?
Yana
Telerik team
 answered on 10 Nov 2009
2 answers
408 views

Hi,

I have two issues.

1.  I have a RadComboBox whose selectedIndex to be reassigned at runtime based on some other actions on the page.  Though I tried setting the ComboBox.SelectedIndex = some number, ComboBox.SelectedValue = some value   - None of the ways I tried seem to work.  The Combo.SelectedItem still stays as the old selected item.  Does not change.  What am I doing wrong?

2.  I have three Image buttons in a CommandItemTemplate on my RadGrid.  These buttons are "Editall", "UpdateAll" and "CancelAll". 

Update and cancel button are initially hidden and the only button visible is Edit.  These buttons are meant to make the grid

bulk-editable and bulk-updateable.  I don't have any per row Command Items.  All the columns are created at runtime.  On inital page load, everything seem to be normal and I can only see the Edit button as expected.  When I click the button, the Grid goes goes into Edit mode (I have the code in ItemCommand event handler).  At this point I can only "see" the Update and Cancel buttons on the Command bar (again as expected).  But the problem is nothing happens when I click on either the update button or the Cancel button.  Seemingly, no event handlers get called.  What am I doing wrong?   I can give you a clue about the scenario.  If I have all the three buttons visible on the initial page load, and I click the Update button, the ItemCommand event handler does get called.  But none of the buttons fires any events on any subsequent page loads.  So, I am thinking, there must be something wrong with my postbacks.  Here is my code.  Please tell me where all do I have to do the ReBind(). The code fragment is partial only.

My aspx file:

<telerik:RadGrid ID="rgForecast" runat="server" AllowSorting="True" AutoGenerateColumns="False"
   ShowStatusBar="True" Width="800px" Skin="Forest" OnNeedDataSource="rgForecast_NeedDataSource"
   OnPreRender="rgForecast_PreRender" GroupingEnabled="False" OnItemCommand="rgForecast_ItemCommand"
   OnItemCreated="rgForecast_ItemCreated" AllowMultiRowEdit="True">
   <MasterTableView CommandItemDisplay="Top" EditMode="InPlace">
    <CommandItemTemplate>
     <div id="EditButtonDiv" runat="server" style="position: relative; float: left;

padding-right: 20px;">
      <asp:ImageButton ID="EditGrid" Text="Edit Items" AlternateText="Edit"

runat="server"
       CommandName="EditAll" ImageUrl="~/Images/Edit.gif" ToolTip="Click to Edit

the Grid" />
     </div>
     <div id="UpdateButtonDiv" runat="server" style="position: relative; float: left;

padding-right: 20px;">
      <asp:ImageButton ID="UpdateGrid" Text="Update Items" AlternateText="Update"

runat="server"
       CommandName="UpdateAll" ImageUrl="~/Images/Update.gif" ToolTip="Click to

update the Grid" />
     </div>
     <div id="CancelButtonDiv" runat="server" style="position: relative; float: left;

padding-right: 20px;">
      <asp:ImageButton ID="CancelUpdate" Text="Cancel Updates" AlternateText="Cancel"

runat="server"
       CommandName="CancelAll" ImageUrl="~/Images/Cancel.gif" ToolTip="Click to

cancel updates" />
     </div>
     <div style="position: relative; float: right; padding-right: 20px;">
      <asp:ImageButton ID="Export2Excel" Text="Export to Excel" AlternateText="Excel

Export" runat="server"
       CommandName="ExportToExcel" ImageUrl="~/Images/MoveUp.gif" ToolTip="Click

to Export grid to Excel" />
     </div>
    </CommandItemTemplate>
   </MasterTableView>
   <ClientSettings>
    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
   </ClientSettings>
   <EditItemStyle BackColor="#FFFF99" />
   <SortingSettings SortedAscToolTip="Sorted Asc" SortedDescToolTip="Sorted Desc" />
   <StatusBarSettings LoadingText="Loading. Please wait....." />
  </telerik:RadGrid>

My cs file:

 protected void rgForecast_PreRender(object sender, EventArgs e)
 {
  RadGrid grid = (RadGrid)sender;
  foreach (GridColumn col in grid.Columns)
  {
   if (Array.IndexOf(strInvisibleCols, col.UniqueName) >= 0)
    col.Visible = false;
   else
   {
    col.ItemStyle.Wrap = false;
    col.HeaderStyle.Wrap = false;
   }
  }
  //grid.Rebind();
 }

 

 protected void rgForecast_ItemCommand(object source, GridCommandEventArgs e)
 {
  if (e.CommandName == "UpdateAll")
  {UpdateGrid();}
  else if (e.CommandName == "EditAll")
  {EditGrid();}
  else if (e.CommandName == "CancelAll")
  {CancelUpdate();}
  //rgForecast.Rebind();
 }

 

 protected void rgForecast_ItemCreated(object sender, GridItemEventArgs e)
 {
  if (e.Item is GridCommandItem)
  {
   GridCommandItem commandItem = e.Item as GridCommandItem;
   ImageButton btnEdit = commandItem.FindControl("EditGrid") as ImageButton;
   btnEdit.Visible = IsKeyerUser((string)Session[Role]) && rgForecast.EditIndexes.Count == 0;
   ImageButton btnUpdate = commandItem.FindControl("UpdateGrid") as ImageButton;
   btnUpdate.Visible = rgForecast.EditIndexes.Count > 0;
   ImageButton btnCancel = commandItem.FindControl("CancelUpdate") as ImageButton;
   btnCancel.Visible = rgForecast.EditIndexes.Count > 0;
  }

 }

Please help!!

Babu.
 

Pavlina
Telerik team
 answered on 10 Nov 2009
17 answers
340 views
I first set the values server side on not postback.

tcCalEnd.DateFrom = Date.Now().AddMonths(-6)
tcCalEnd.DateSelected = Date.Now()

Then when I click a radio button via javascript I run the function on the client side
var datePickerTo = $find("ctl00_cphBody_tcCalEnd_RadDatePicker1");              
datePickerTo.set_maxDate(MaxDate);
datePickerTo.set_minDate(MinDate);
datePickerTo.set_selectedDate(MaxDate);

The value in the input box is the date from the client side function. 

But when I click submit - the value from the raddatepicker is set to the original serverside values.  It doesn't save the client side values.  Which I ran after the serverside.  Is there something else I have to do to save it?



Pavel
Telerik team
 answered on 10 Nov 2009
1 answer
115 views
I have a Default.aspx page, it contains a splitter control which divides the page to two parts, the leftpane and mainpane. The leftpane ContentUrl is set to LeftNav.aspx and mainpane ContentUrl is set to Main.aspx.

My question is, how do I call the javascript ajaxrequest that resides in LeftNav.aspx from Main.aspx? Basically I want certain action inside Main.aspx page to trigger an Ajax request on the LeftNav.aspx.

I know I can always use javascript function set_contentUrl('LeftNav.aspx') to refresh the LeftNav.aspx page URL, but the page refresh doesn't look as good as an Ajax request where you don't see the whole LeftNav refreshed.

Is this doable?

Thanks!
Svetlina Anati
Telerik team
 answered on 10 Nov 2009
1 answer
124 views
When I copy some text with some formatting (bullets etc) from word and paste it onto the editor, it does not get rendered properly.
For example, pasted text has had some additional spacing in between bullets which was not there in the original text. I have not seen this issue on the Telerik demo site. Is it something to do with the version or am i missing something? Is there any issue with the html and the formatting of ms-word?

Please help. Thanks in advance.
Stanimir
Telerik team
 answered on 10 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?