User Profile & Activity

Hans Kristian Member
Page
of 69
Posted: March 21, 2012 5:00 AM

Hello,

Could you tell me how you set up Format Conditions?

I suggest you to set the customize value in WebGrid by using server side event InitializeRow. Your customize value will also be exported.

Let me show you how to use InitializeRow.

In my example, I’m using nortwind.mdb database and shippers table and I want to change the Phone field value if CompanyName field value is ‘Speedy Express’.


Here’s the code:

protected void WebGrid1_InitializeRow(object sender, RowEventArgs e)
{
   if (e.Row.Cells[1].Text == "Speedy Express") // If CompanyName is Speedy Express
   {
      e.Row.Cells[2].Text = "(021)4563219"; // Set Phone to (021)4563219
   }
}


I'll attach some screenshot so you can see the result in WebGrid in "WebGrid-Result.png" file and the result after I export that WebGrid to Excel in "Excel-Export-Result.png" file.

As you can see, in "Excel-Export-Result.png" file the new value are also exported.


For further information about this event, please check in WebGrid documentation (InitializeRow Event).


Hope this helps. Thank you.

Regards,

Hans K.

Hello,

I’m sorry, unfortunately we can’t configure first day of week in CalenderCombo.

Regards,

Hans K

Hello,

I’m sorry for this inconvenience. The reason why we show that error message because basically there is a bug in IE9 if we are using iFrame and the link “problem” is referring you to the Microsoft forum thread that discuss about this issue/bug.

I’ll give you an attachment, screenshot about that thread

If you want to see our live sample, please change your IE browser mode to “Internet Explorer 8”.

Hope this helps. Thank you.

Regards,

Hans K.

Posted: March 20, 2012 9:47 PM

Hello,

I’m sorry for this issue. Please add an additional boolean parameter in ClearSelectedObject() function. Here’s how to add the parameter: grid.ClearSelectedObject(true);

Hope this helps. Thank you.

Regards,

Hans K.

Posted: March 19, 2012 10:46 PM

Hello,

Yes, you could deselect grid row in client side by using ClearSelectedObject() function. Here's how to use that function: grid.ClearSelectedObject();

For further information about this function, please check our WebGrid documentation (How-to: Clear selected object)

Hope this helps. Thank you.

Regards,

Hans K.

Posted: March 15, 2012 12:05 AM

Hello,

Basically when building a Web page is that Web pages don't handle white space characters the same way that word processors do. When you write your HTML, you can add any number of these white space characters into your HTML. But when you view that HTML in a Web page, one white space will be displayed.

In order for those spaces to display in your web browsers you need to use one of HTML character entities like “ 

To set the display of your webgrid value (in this case , cell’s value). You need to set text property, not on value property. So please make a little change in your script.

From:

e.Cell.Value = e.Cell.Value.ToString().Replace(" ", " ");

To:

e.Cell.Text = e.Cell.Value.ToString().Replace(" ", " ");

Hope this helps. Thank you.

Regards,

Hans K

Posted: March 14, 2012 12:25 AM

Hello,

Yes, it is possible to customize the event based on some conditions.

You can use DisableEdit, DisableMove and DisableResize in certain event by using OnEventBound clientside event.

In OnEventBound, you can also retrieve your custom field information inside MasterObject property. (evt.MasterObject).

Please see my code snippet in below for more details.

function WebScheduler1_OnEventBound(controlId, evt)

{

var WebScheduler1 = ISGetObject(controlId);

var CustomField = evt.MasterObject.CostumField; // evt.MasterObject.[your costum field name]

if (CustomField == 100) {

evt.DisableEdit = true;

evt.DisableResize = true;

evt.DisableMove = true;

}

return true;

}

Hope this helps. Thank you.

Regards,

Hans K.

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