User Profile & Activity

Hans Kristian Member
Page
of 69
Posted: August 10, 2012 7:27 AM
Hello,

Thank you for the question.

If you want to select the WebGrid’s cell, like you did in Excel.
Please try to set the “CellClickAction” property to “CellSelect”.

Regards,
Hans.
Hello,

I’m glad that you have found a work around.

Thank you for your feedback.
I made a sample base on your code, but unfortunately, I can’t replicate your issue on my end.
I use Nortwind database and Customers table in my sample.

I attached my sample. Please have a review on my sample and let me know if there are settings that I missed.

Could you provide me your WebGrid and Framework in your current project?

Thank you.

Regards,
Hans.
Posted: August 9, 2012 10:34 PM

Hello,

I’m glad to hear that you have found the solution for this issue.
Should you have further question, please do not hesitate to contact us.

Thank you.

Regards,
Hans.

Posted: August 9, 2012 4:35 AM
Hello,

It seems the issue occurs because of difference rendering between the “Product Number” in database and WebGrid.
For example, Product Number in database is “123 758    895”, but in WebGrid become “123 758 895”

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 “&nbsp”

To resolve this issue, please try to add a validation in WebGrid’s InitializeCell server side event.
Here’s the snippet example code:
protected void WebGrid1_InitializeCell(object sender, ISNet.WebUI.WebGrid.CellEventArgs e)
{
	if (e.Cell.Column.Name == "Product Numbers")
	{
		e.Cell.Column.ColumnType = ISNet.WebUI.WebGrid.ColumnType.Custom;
		e.Cell.Text = e.Cell.Value.ToString().Replace(" ", "&nbsp");
	}
}


Hope this helps. Thank you.

Regards,
Hans.

Posted: August 8, 2012 6:56 AM
Hello,

Thank you for your code.

After I investigated your code, I have some recommendation for you.

If you want rebind the WebGrid, you should use RebindDataSource() method instated use DataBind() method.
And before use RebindDataSource() method, you should use ClearCachedDataSource() method.

WebGrid1.ClearCachedDataSource();
WebGrid1.RebindDataSource();

To further information about server-side of WebGrid, you could see in our documentation, in Server-side Events section.
(Intersoft WebGrid > WebGrid Features Overview > Programming with Server-side API > Server-side Events)


For a better performance in your scenario, I recommend you to use FlyPostBack instated use FullPostBack.

I made a simple about WebGrid that integrated with WebTreeView using FlyPostBack.
Bind WebGrid and WebTreeView programmatically to Nortwind.mdb database.
In my sample, the data of WebGrid is depend on what the WebTreeView’s node that we select.

Please have review on my sample and let me know your response.

Thank you.

Regards,
Hans.

Posted: August 6, 2012 11:57 PM

Hello,

Would you mind to provide me more information about your scenario?

For example, how do you display the data in the WebTab.

As far I know, WebTab is only a content control and it can load any control inside the tab pages.

In my humble opinion, the load data should be in a control that would be loaded inside our WebTab, correct?

In this case, I would need to know your details scenario before can suggest anything.

Thank you.

Regards,

Hans.

Hello,

Thank you for your information and code.

I made a simple sample that maybe similar with your scenario.
I adding the columns during the PrepareDataBinding event server side as well.

However I still can’t reproduce your issue on my end.
Would you mind to modify my sample, so it can replicate your issue? And could you please tell me the setting that I’ve missed in my sample?

Thank you.

Regards,
Hans.

Posted: August 6, 2012 12:44 AM
Hello,

No, there aren’t examples about OnTabChanged in WebTab.
To invoke the OnTabChanged (server side), you should set “AutoPostBack” property to “True”.

I made a simple sample about OnTabChanged. Please have review on my sample and let me know your response.

Thank you.

Regards,
Hans.

Hello,

Thank you for the code.

Could you provide me more information about your code?
For example, where do you get the value of “returnObj”? Or what function and how you call the function to hide the column?

Or if you don’t mind, could you provide me a simple sample that replicate this issue?

So I can help you to investigate this issue further more.

Thank you.

Regards,
Hans.

Hello,

Thank you for your sample.

After I investigated you code, it seems the issue persist due to mistakenness in your code.
You already define the WebGrid’s structure from the beginning you create the WebGrid.
Therefore, you couldn’t delete the structure just by using this code:

WebGrid1.LayoutSettings.Hierarchical = false;WebGrid1.ClientAction.RefreshModifiedControls();

And as far I know, you couldn’t delete table by using this query code:

string StrSql = "Delete from Schedules ";

However, if want to make any changes in your WebGrid’s structure.
I recommend you to create the WebGrid’s structure programmatically.
With this scenario, you could have more dynamic WebGrid’s structure.

Regards,
Hans.

All times are GMT -5. The time now is 2:27 PM.
Previous Next