Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
102 views
Hi,

I was hoping to to change a GridBoundColumn row value to be a LinkButton when the Edit button is clicked.

Here's the column:
<rad:GridBoundColumn DataField="FileName"  UniqueName="NameColumn" />

Then I'm guessing the change needs to take place when the EditCommand event is raised
void ListGrid_EditCommand(object source, GridCommandEventArgs e)

So how would I find the "NameColumn" and change its value to a LinkButton on Edit?

Also, is it possible to get the Row DataItem on the EditCommand event? I wasn't able to find a way to do this. 
Jayesh Goyani
Top achievements
Rank 2
 answered on 09 Apr 2011
4 answers
92 views
Hi,

I'm evaluating the RadChart control and I have some questions about scale breaks:

- Is it possible to set the height of the different segments? For example: I'm using four segments. When I display the four segments the area for each segment is the same (height for each segment is about total height/4), but when I display three or two segments the height of one segment is bigger than the rest. I would like the height segments to be the same in all the cases.
(I've attached some screenshots for this example).

- Is it possible to set the Y-Axis labels for each segment with a different appearance (for example text color)?

- Is it possible to set a different background color for each segment?

Thanks in advance.
John.
john
Top achievements
Rank 1
 answered on 09 Apr 2011
4 answers
126 views
Hello, I'm using a gridtemplatecolumn to find the differnce betwean two date columns. I then want to take the average of that column which I do through code. It works fine until a filter is applied on any column. I've have the code shown below. Any suggestions?

<

 

 

telerik:GridDateTimeColumn UniqueName="DatePlaced" DataField="DatePlaced" HeaderText="Date Placed"

 

 

 

 

HeaderStyle-Width="160px" DataFormatString="{0:d}">

 

 

 

</telerik:GridDateTimeColumn>

 

 

 

<telerik:GridDateTimeColumn UniqueName="DateShipped" DataField="DateShipped" HeaderText="Date Shipped"

 

 

 

 

HeaderStyle-Width="160px" DataFormatString="{0:d}">

 

 

 

</telerik:GridDateTimeColumn>

 

 

 

<telerik:GridTemplateColumn DataField="DaysToShip" HeaderText="Days To Ship" >

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblDaysToShip" runat="server"></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

<FooterTemplate>

 

 

 

<asp:Label ID="lblDaysToShipFooter" runat="server"></asp:Label>

 

 

 

</FooterTemplate>

 

 

 

</telerik:GridTemplateColumn>


C# code

 

 

double

 

 

totalRows, countRows;

 

 

protected

 

 

 

void TrackingGrid_ItemDataBound(object source, GridItemEventArgs e)

 

 

{

 

 

 

 

if (e.Item is GridDataItem)

 

 

{

 

 

 

 

GridDataItem item = (GridDataItem)e.Item;

 

 

(item.FindControl(

 

 

"lblDaysToShip") as Label).Text = DateTime.Parse(item["DateShipped"].Text).Subtract(DateTime.Parse(item["DatePlaced"].Text)).Days.ToString();

 

 

totalRows +=

 

 

Double.Parse((item.FindControl("lblDaysToShip") as Label).Text);

 

 

countRows += 1;

 

}

 

 

 

 

if (e.Item is GridFooterItem)

 

 

{

 

 

 

 

GridFooterItem footerItem = e.Item as GridFooterItem;

 

 

(footerItem.FindControl(

 

 

"lblDaysToShipFooter") as Label).Text = "Average days: " + (totalRows / countRows).ToString("N2");

 

 

}

 

}


Thanks for your help
Greg

Greg
Top achievements
Rank 1
 answered on 08 Apr 2011
3 answers
421 views
I have seen plenty of forum thread but none of them, even the current ones, supply a resolution to exporting to Excel 2007 using the "XLSX" extension. 

I am using the Ajax Q1 release for 2011 and ASP.Net 4.0 assemblies.  What do I need to change here to export a grid to an xlsx file??

RadGrid1.MasterTableView.ExportToExcel()

I have tried added the following to the RadGrid export settings before call the export method but get a file format or extension is invalid exception:

RadGrid1.ExportSettings.Excel.FileExtension = "xlsx"

Daniel
Telerik team
 answered on 08 Apr 2011
6 answers
142 views
Hi,

I'am trying now to focus a particular textbox when the user click the edit button.

I found this very helpful thread on your support base, but it doesn't work (javascript approach) if my grid is ajaxified.

What is the solution ?

Thanks in advance.
Sean
Top achievements
Rank 1
 answered on 08 Apr 2011
1 answer
34 views
Hi

We are currently using ASP.NET ImageMap to display dynamically generated images, that have hotspots, in our web app, which also uses Telerik ASP.NET AJAX controls extensively.

ASP.NET ImageMap control requires that the image file be a physical file sitting in our web app folders and you specify the URL to that file.  This requires that we need to create temp files and manage them - deleting etc.

To avoid creating those 'physical files' and use in-memroy images, I realize we can cache the image and write a HTTP handler that can stream the image from that cache. 

Before I sit down and write my own handler...

I was wondering if we can pile onto the Telerik.Web.UI.WebResource that does similar work for Telerik's resources.  Does it expose any functionality where we can tell it say - here is the image stream, that is in this cache, serve this image when the request is made in certain fashion for the image resource?

Any pointers appreciated.

Regards
Athadu
Athadu
Top achievements
Rank 1
 answered on 08 Apr 2011
2 answers
82 views
Hi all,

I have a radgrid with two template columns i use to show the data instead of database ids, but when i run it ,it only shows the headers of the template columns not the data. What could be the reason?

Regards,
Hamda
HL
Top achievements
Rank 1
 answered on 08 Apr 2011
2 answers
192 views
Hi,

I have a Radgrid and using a telerik:GridBinaryImageColumn.
I've hooked up the Radgrid to a SqlDataSource allowing Automatic INSERTS/UPDATES/DELETES.
My table has a column "Logo" which is of "image" type and allows nulls.

If I create a record and upload an image everything is fine. But when I click update and update a different field for example "name", then the image gets deleted because I never selected one! So every time I update I have to select an image, and I'm sure you can see that that is a problem.

Any help would be great thanks.
Darren
Can
Top achievements
Rank 1
 answered on 08 Apr 2011
2 answers
324 views
Sirs:
I'm trying to code server side validation like you document here:
http://www.telerik.com/help/aspnet/grid/grdvalidation.html
under the 'Adding a validator to EditItemTemplate of GridTemplateColumn' section.

I'm trying to get the code to use a ValidationSummary control so I can show a more detailed error message at the top of the grid. Is this possible?



Steve Gray
Top achievements
Rank 1
 answered on 08 Apr 2011
2 answers
80 views
I'm creating a couple of datepickers programatically and I'm adding them to Panel object. I'm trying to add an attribute to the datepickers when they're created to run a JavaScript that opens the calendar when the input box of the date picker is clicked. This works great for datepickers that I've created on the client side and add this attribute server side, but when I create the datepickers server side, I'm not getting the full ClientID.

here is how I'm creating the datepickers and setting the attributes:
Panel edpanelContent = new Panel();
edpanelContent.Attributes.Add("class", "popupcontent");
RadDatePicker eddp = new RadDatePicker();
eddp.ID = "dp_ENDDATE";
eddp.DateInput.Attributes["onclick"] = String.Format("showPopUp('{0}');", eddp.ClientID);
edpanelContent.Controls.Add(eddp);

when I look at the page source, it's referencing the ID being passed to the JavaScript as just "dp_ENDDATE" without all the other pathing that goes along with it. The client id should look like this
ctl00_MainContent_ctl00_RadGrid2_ctl00_ctl02_ctl02_dp_ENDDATE_dateInput_text

Is there a way to set this up so I can assign the JavaScript to the DateInput server side when the control is created? Thanks.
Philip Senechal
Top achievements
Rank 1
 answered on 08 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?