User Profile & Activity

John Bonin Member
Page
of 18
Posted: May 10, 2012 2:39 PM

Here is a complete project which shows the problem.  Includes all dll's.  Also here is an animated gif that shows how it reacts in the browser (IE 8).  I am using VS 2008.  If I remove the UpdatePanel then all works.  Problem is only when an Updatepanel is used.

 

 

Posted: May 10, 2012 7:15 AM

Thanks Hans,

  What I am trying to do is if a users selects Other a textbox appears allowing them to enter more information in a textbox.

 I am using the latest HotFixes.  I will try to create a complete projects with all files that shows the problem.

 

Posted: March 28, 2012 9:46 AM

Thanks Hans for your help and samples.  I also tried the DataTable at one time and there wasn't much difference and was not worth it.  Using a hidden column, that is already in the database works the best.

 

Thanks

Posted: March 27, 2012 9:28 AM

Thanks, that's what I ended up doing, creating a new column and formatting the new column based upon the original column.  Would be better and I believe performance would be better if the export was done from the cache data as opposed to going back to the database and getting the values again, but I can see why they did that. 

 

Again thanks for all you samples...

John

Posted: March 22, 2012 9:47 AM

Hi,

 

  Again thanks for the sample.  I guess I was't  clear, completely my fault, sorry.  The problem arises when the field is a number.  When displaying data in the grid you can modify the text property of cell,  so if a cells value is null or let's say less than 10, you can change the text property of that cell to be a string like "***".  But when you export to excel it goes back to the database to get all the values again and if a field is a number, the export expects a number so you can not change the text property, you can only change the value property. 

Let's say you added a number field, like  Qty, in the InitalizeRow event when displaying to the grid you can do:

  if e.row.cells.getnameditem("qty").value < 10 then    ' could use value or text here

     e.row.cells.getnameditem("qty").text = "Order more"

  end if

When going to the grid, for those cells where Qty is less than 10, you will see "Order more" but when you export you will see the actual numbers that is in the database.  If you try to change the value to be "Order more" you will get an error that you can add a string to a number field.

So I guess what I would like to happen is to export what is displayed on the grid not what is in the database.

Posted: March 21, 2012 9:35 AM

Thank you for the information.  I am using the FormatConditions within the webGrid definition not in code behind.  Your method works if there is a value in the database but it appears not to work when the value is null.  i use the NullText="**" attribute in the defintion but if I put the code in the InitializeRow event, I need to modify both the value and the text in order show the changes on the grid, but when exported an error occurs becuase my field is a single value (I need to maintain it this way for filtering) and a value of "**" is not a number so it fails. 

 

Posted: February 7, 2012 9:54 AM

Yes I can replicate this issue using your sample. 

 

I didn't modify the master page, the only change was to FirstExperience.aspx adding the SHowColumnAction="True" to the layout settings and adding enough space above the table that holds the webgrid so that when you run the sample you get a vertical scrollbar.  If you don't see the scrollbar increase the height of the empty div until you see one.  The table that holds the webgrid MUST be at the bottom of the page and not at the top.  Now once you have enough space to see a scrollbar, use the scrollbar to move the top of the grid up in the page, then  first click on the column action button of a column to bring up the menu, and then right click on the column header, the top of the context menu that displays is not where it is suppose to be, it is off the top.

 

This issue is only seen if there is a vertical scrollbar and the scrollbar is not at the top.  In your FirstExpoerience sample you sent change the height of the div from 260px to 500px and try again.

 

<asp:Content ID="Content1" ContentPlaceHolderID="content" runat="Server">
	<div style="height: 500px"> </div>
	<table align="center" cellpadding="0" cellspacing="0" style="table-layout: fixed;
		background-image: url(images/back_ui_3.png); width: 799px; height: 379px;">
		<tr>
			<td style="height: 61px">
			</td>
		</tr>
		<tr>
			<td style="padding-left: 15px; padding-top: 4px;" valign="top">
				<ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="297px" UseDefaultStyle="True"
Posted: February 6, 2012 1:55 PM

Any word on this problem?  Still doesn't work with R2 SP1.

Posted: January 17, 2012 9:41 AM

Here is a short demo showing the problem.  Thios demo is using IE.  There is a similar problem in the latest version of Firefox but with other elements.

Posted: January 9, 2012 1:24 PM

Handy,

  Thanks, all issues with webGrid were fixed with this build.

 

John

All times are GMT -5. The time now is 9:22 PM.
Previous Next