Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
174 views
Hi

I have a grouped grid and I am trying to prevent the groups from being collapsed by hiding the expand collapse button. I have followed the info in the help file and i have tried both approaches (column created event and grid pre render event) but the column is refusing to disappear!

    Protected Sub gridJourneys_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles gridJourneys.ColumnCreated  
        If TypeOf e.Column Is GridGroupSplitterColumn Then  
            e.Column.HeaderStyle.Width = Unit.Pixel(0)  
            e.Column.HeaderStyle.Font.Size = FontUnit.Point(0)  
            e.Column.ItemStyle.Width = Unit.Pixel(0)  
            e.Column.ItemStyle.Font.Size = FontUnit.Point(0)  
            e.Column.Resizable = False 
 
        End If  
    End Sub  
 
    Private Sub gridJourneys_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles gridJourneys.PreRender  
 
        For Each column As GridColumn In gridJourneys.MasterTableView.RenderColumns  
            If (TypeOf column Is GridGroupSplitterColumn) Then  
 
                column.HeaderStyle.Width = Unit.Pixel(0)  
                column.HeaderStyle.Font.Size = FontUnit.Point(0)  
                column.ItemStyle.Width = Unit.Pixel(0)  
                column.ItemStyle.Font.Size = FontUnit.Point(0)  
                column.Resizable = False 
            End If  
        Next  
    End Sub 

The code is detecting the GridGroupSplitterColumn in both cases but it is not affecting the column appearance. In fact i can't make the column any bigger in those code snippets either.

I have set the client side resizable property to true

Here is the grid in case there are any pertinent properties you need to see there

<telerik:RadGrid ID="gridJourneys" runat="server"  Width="960px" AutoGenerateColumns="False" GridLines="None" skin="SkyBlue">  
<MasterTableView DataKeyNames="JourneyID" CommandItemDisplay="Top" Name="Journeys" ShowFooter="True" ShowGroupFooter="True" > 
 <CommandItemTemplate> 
 <table cellpadding="5" cellspacing="0">  
 <tr> 
 <td colspan="2"> <span class="title"><asp:Label ID="lblTitle" runat="server" Text="Title"></asp:Label></span> </td> 
 </tr> 
 <tr> 
    <td>No Journeys</td> 
    <td><asp:Label ID="lblNoJourneys" runat="server"></asp:Label></td>  
 </tr> 
 <tr> 
    <td>Total Distance</td> 
    <td><asp:Label ID="lblTotalDistance" runat="server"></asp:Label></td>  
 </tr> 
 <tr> 
    <td>Total Time</td> 
    <td><asp:Label ID="lblTotalDuration" runat="server"></asp:Label></td>  
 </tr> 
 
 </table> 
 <br /> 
  </CommandItemTemplate> 
 
<NoRecordsTemplate> 
There are no journeys on this date.  
                
</NoRecordsTemplate> 
 
<GroupByExpressions> 
<telerik:GridGroupByExpression> 
<SelectFields> 
<telerik:GridGroupByField  FieldName="StartDate"  FieldAlias="StartDate" FormatString="" HeaderText=""/>  
<telerik:GridGroupByField FieldAlias="TotalDistance" Aggregate="Sum" FieldName="DistanceTravelled" FormatString="" HeaderText=""   /> 
<telerik:GridGroupByField FieldAlias="TotalTime" Aggregate="Sum" FieldName="TimeTakenInSeconds" FormatString="" HeaderText=""   /> 
<telerik:GridGroupByField FieldAlias="Count" Aggregate="Count" FieldName="JourneyID" FormatString="" HeaderText="" /> 
</SelectFields> 
<GroupByFields> 
<telerik:GridGroupByField  FieldName="StartDate" FieldAlias="StartDate" FormatString="" HeaderText=""/>  
</GroupByFields> 
</telerik:GridGroupByExpression> 
</GroupByExpressions> 
 
 
<Columns> 
     <telerik:GridBoundColumn DataField="JourneyID" Aggregate="Count" Visible="False" FooterAggregateFormatString="{0}" UniqueName="JourneyID"></telerik:GridBoundColumn> 
    <telerik:GridBoundColumn DataField="StartDateTime" DataFormatString="{0:dd/MM/yy HH:mm}" HeaderText="Start Time" UniqueName="StartDateTime">  
        <ItemStyle Width="100px" /> 
    </telerik:GridBoundColumn> 
    <telerik:GridTemplateColumn HeaderText="Start Location" UniqueName="StartLocation">  
    <ItemTemplate> 
                <asp:label runat="server" id="lblStartLocation"/>  
    </ItemTemplate> 
        <ItemStyle Width="280px" /> 
</telerik:GridTemplateColumn> 
<telerik:GridBoundColumn DataField="EndDateTime"  DataFormatString="{0:dd/MM/yy HH:mm}" HeaderText="End Time" UniqueName="EndDateTime">  
    <ItemStyle Width="100px" /> 
</telerik:GridBoundColumn> 
<telerik:GridTemplateColumn HeaderText="End Location" UniqueName="EndLocation" > 
<ItemTemplate> 
  <asp:label runat="server" id="lblEndLocation"/>  
      
</ItemTemplate> 
    <ItemStyle Width="280px" /> 
</telerik:GridTemplateColumn> 
 
<telerik:GridBoundColumn DataField="TimeTakenInSeconds" DataFormatString="{0}" UniqueName="TimeTakenInSeconds" Aggregate="Sum" FooterAggregateFormatString="{0}" Visible="False" > 
</telerik:GridBoundColumn> 
 
<telerik:GridBoundColumn HeaderText="Duration" DataField="TimeTaken" UniqueName="TimeTaken">  
 <ItemStyle Width="100px" /> 
</telerik:GridBoundColumn> 
 
<telerik:GridBoundColumn DataField="DistanceTravelled" DataFormatString="{0:F2}" HeaderText="Distance" UniqueName="DistanceTravelled" Aggregate="Sum" FooterAggregateFormatString="{0:F2}">  
    <ItemStyle Width="100px" /> 
</telerik:GridBoundColumn> 
 
 
 
 
</Columns> 
</MasterTableView> 
    <HeaderContextMenu EnableEmbeddedSkins="False" Skin="SureTrack">  
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </HeaderContextMenu> 
    <ClientSettings> 
        <Resizing AllowColumnResize="True" /> 
    </ClientSettings> 
    <FilterMenu EnableEmbeddedSkins="False" Skin="SureTrack">  
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </FilterMenu> 
</telerik:RadGrid> 

I am using q3 2008.

many thanks
Daniel
Telerik team
 answered on 27 Jul 2009
1 answer
114 views
Hi There

I have a radgrid control, Skin is Vista Multi edit row is set to true and i load the control in edit mode.

 

For Each item As GridItem In radResourceLists.MasterTableView.Items

 

 

If TypeOf item Is GridEditableItem Then

 

 

Dim editableItem As GridEditableItem = CType(item, GridDataItem)

 

editableItem.Edit =

True

 

editableItem.BorderStyle = BorderStyle.None

 

End If

 

 

Next

 


When the cotrol load with edit mode all the rows are highlighted in blue so i set EditItemStyle-BackColor="White"
and now the grid is not highlighted in blue. But now the editem item load with blue border around. I tried some properties to remove as i don't want the border to show. Can you please direct me to the right property to do so

Thanks
Tony
Tony Abou-Akl
Top achievements
Rank 1
 answered on 27 Jul 2009
1 answer
170 views
I am loading a user control in a RadDock at runtime that uses both a RadCalendar and RadScheduler.  We are using Telerik.Web.UI assembly version 2009.2.701.20.  After the page has loaded, with the data from the database, there are 2 javascript errors. 
The first is:  '0._preInitialized' is null or not an object
The second is:  Expected ':' (that's a colon).

Anyone seen either of these errors before?  We are using very similar code in another project and it works without issue.
TCN
Top achievements
Rank 1
 answered on 27 Jul 2009
1 answer
125 views
Hello.  I am unable to find the RadBinaryImage control in the Telerik controls group so I manually typed in <telerik:RadBinaryImage id="binaryimage" runat="server>  After trying to make that work, I still have a problem with the radBinary Image even being displayed.  i get the message: "RadBinaryImage is not a known element"
Atanas Korchev
Telerik team
 answered on 27 Jul 2009
3 answers
163 views
Hi Telerik,

I have controls inside form template or radgrid. When click on the edit button i am able to get the controls which are present inside <formtemplate> of grid inside DataBound() event. But when I click on Add new record option I am unable to find the controls id in RadGrid_DataBound() event.

So Please tell me how I fix this as soon as possible.
Its very urgent.

Thanks,
Monalisa
Pavlina
Telerik team
 answered on 27 Jul 2009
1 answer
109 views
Using HistoryPoints in NET 3.5...

I can select the tab in the onnavigate event but since this event occurs AFTER the page_load
I am unable to trigger the server side TabClick event which loads the content of the tabs.

The content of each tab is a user control that is loaded by the TabClick event.  This event
is not been fired by the Ajax history onnavigate event.

The onnavigate event does fire the page_load BUT it does it before it executes and sets
the tab.selectIndex property.

Any suggestions/solutions would be most appreciated as usually :) 
Atanas Korchev
Telerik team
 answered on 27 Jul 2009
4 answers
127 views
I have the following:

<telerik:RadComboBox ID="healthNumberCmbo" runat="server" AllowCustomText="true" 
HighlightTemplatedItems="true" EnableLoadOnDemand="true" LoadingMessage="Loading ..." Height="250px" 
MarkFirstMatch="true" OnClientItemsRequesting="onClientItemsRequesting" 
OnClientItemDataBound="onClientItemDataBound"> 
     <WebServiceSettings Method="GetPatients" Path="Services/PatientAC.asmx" /> 
</telerik:RadComboBox> 
 
<!-- Client-side Data Template --> 
<div id="myTemplate" class="sys-template"> 
     <b>Name:&nbsp;</b>{{FullName}}<br />                  
     <b>DOB:&nbsp;</b>{{BirthDate.format("MM/dd/yyyy")}}<br />                               
     <b>HC#:&nbsp;</b>{{HealthNumber}} 
</div>

function onClientItemsRequesting(sender, eventArgs) 
{ 
    var context = eventArgs.get_context(); 
    context["filterString"] = eventArgs.get_text(); 
} 
 
function onClientItemDataBound(sender, eventArgs) 
{ 
    var item = eventArgs.getItem(); 
    var dataItem = eventArgs.get_dataItem(); 
  
    // set the attributes that we can use when they select the item 
    item.get_attributes().setAttribute("healthNumber", dataItem.HealthNumber); 
    item.get_attributes().setAttribute("fullName", dataItem.FullName); 
    item.get_attributes().setAttribute("birthDate", dataItem.BirthDate); 
 
    // set the value to the ID of the patient 
    item.set_value(dataItem.PatientID); 
 
    var template = new Sys.UI.Template($get("myTemplate")); 
    template.instantiateIn(item.get_element(), dataItem); 
} 

I've based my functionality off of the blog post here .. my issue is this:

When the user clicks to open the combo box, and it loads, and they use the UP and DOWN arrows on the keyboard, the text that gets set in the combo box is what was in the template for that item. 

How can I use the template, but at the same time - be able to only put the Health Number in the textbox. The reason is that we have clientside validation by using the CustomValidator - and for that to work before you select the item, the text in the box needs to be what i'm expecting. 

Case 1: What I currently get in the textbox when the user uses the UP/DOWN keys and doesn't press enter or leave the combo ...
Name: Some Guy DOB: 1/1/2009 HC#: 1234567890

Case 2: What I want in the textbox under that situation:
1234567890

I'm using a validation RegEx of "^\\d{10}$", which obviously isn't valid under Case 1 .. 

Help!
Simon
Telerik team
 answered on 27 Jul 2009
6 answers
220 views

I have implemented a custom FIleBrowserContentProvider successfully, and have it working with RadEditor.

Is there a way to cause the ImageEditor's Save functionality call a custom FileBrowserContentProvider?

Looks like the 'cannot write to folder' alert is getting hit in the _saveButtonClickHandler in ImageEditor.ascx:

 

var name = this.get_newImageName()+$get("NewImageExt").innerHTML;

 

 

if (!name || name.indexOf(separator) != -1)

 

{

alert(localization[

"MessageCannotWriteToFolder"]);

 

 

return;

 

}

I have not made any changes to any of this code.

Suggestions?

Laku
Top achievements
Rank 1
 answered on 27 Jul 2009
1 answer
119 views
Hi

I am generating a CSV file on the fly in my aspx page. RadCompression is giving me an error when processing is done and it is about to send a "application/octet-stream" content type to my page.

Here's my code.

                string strFileContent = sb.ToString(); // This is the CSV string generated 
 
                // EXPORT 
                string strFile = "export.csv"; 
                string ContentType = "application/octet-stream"; 
 
                Response.Clear(); 
                Response.ContentType = ContentType; 
                Response.AddHeader("Content-Disposition", "attachment; filename=\"" + strFile + "\""); 
                Response.Flush(); 
                Response.Write(strFileContent); 
                Response.End(); 

I had to remove RadCompresstion from the web.config to get this working. Thanks.
Rosen
Telerik team
 answered on 27 Jul 2009
1 answer
98 views
All-
Are there any examples/help out there for this scenario?
I have a few tables that I am loading into some RadGrids for editing. 
A few of the columns are really lookup/reference table data.  The primary table has foreign keys over to the various reference tables.

I want to show the description(from the reference table) as a label in read-mode.  But when it goes to "Edit" mode, switch to boundCombo boxes to allow those lookup fields to be selected from the dropdowns.

Then on the "Update" submit the edited row back for updating. 

I am using an EF model for testing but also have some WCF services for the CRUD methods if I need them.

Any help would be great-
MJD
Sebastian
Telerik team
 answered on 27 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?