User Profile & Activity

Martin Lie Support
martin@intersoftsolutions.com
Page
of 43
Posted: November 11, 2010 9:31 PM

Hello,

You can use ResizeBestFit() method to implement your scenario.

Here is the following code:

window.onload = function () {
   var WebGrid = ISGetObject("WebGrid1");
   var GetCol = WebGrid.RootTable.Columns;
   var ColLength = GetCol.length;

   for (var i = 0; i < ColLength; i++) {
      GetCol[i].ResizeBestFit();
   }
}

Hope this helps. Thank you.

Hello Maged,

For your information, this issue has been fixed by the developer team and it will be available in the next hotfix build. Therefore, you may apply the latest hotfix update using Update Manager when the official hotfix is released.

Thank you.

Posted: November 10, 2010 10:23 PM

Hello Indah,

I have created a sample file that replicates your scenario. In the sample, I simply bind WebGrid to Employee table using SqlDataSource. Before you run the sample, ensure that you have Northwind.mdf which is located in [Installation Folder]\Intersoft Solutions\WebUI Studio for ASP.NET\Data.

From the sample attached, I have successfully added a new row without any Javascript error that you have encountered. The issue might come from your SqlDataSource configuration.

Could you provide your SqlDataSource configuration, so that I can help checking what causes the error on your end?

Attached is the sample file for your reference.

Thank you.

Posted: November 10, 2010 9:10 PM

Hello Andre,

Glad to hear the good news.

Should you have further questions, please feel free to post your issue in the community site and we will be glad to assist you.

Thank you.

Hi Maged,

I have replicated your scenario using WebGrid binding to WebService, and I did encounter the Javascript error when I added a new row in an empty grid.

I have reported this issue to the developer team to be processed. It will consider as a possible bug, but the issue needs to be investigated further.

I will let you know once I get the update from the developer team.

Thank you.

Posted: November 9, 2010 11:48 PM

Hi Andre,

Glad to hear you have found out a way to edit the template.

In that sample, UXStackButton is using GridStyle in its StackMode. By using this mode, the text will be placed below the icon.

If you browse to the sample located in C:\Program Files\Intersoft Solutions\Intersoft WebUI Studio 2010 R1\Samples\SL4\ClientUI Samples\ClientUI.Samples.sln, you can view the styles that the UXStackButton used in that sample.

Thank you.

Posted: November 8, 2010 6:45 AM

Hi Andre,

Please bear with me while I'm going to process your inquiry as soon as possible. I will try to create a basic sample for your reference.

Thanks.

Posted: November 8, 2010 4:51 AM

Hello,

You can pass the parameter using event.srcElement. Please refer to the following code:

function DoClick() {
   var SelectedColumn = event.srcElement.innerText;
   alert(SelectedColumn);
 }

Hope this helps. Thank you.

Posted: November 8, 2010 1:55 AM

Hello,

To change background color via Server-side, you can use OnInitializeRow Server-side event such as following:

protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
   e.Row.Style.BackColor = System.Drawing.Color.Red;
}

To change background color via Client-side, you might want to refer to javascript code given by Frank Bruce. The code has been successfully tested and it will change the text color in your WebGrid.

Thank you.

Posted: November 8, 2010 12:54 AM

Hello,

You can still perform column clicking even when AllowSorting is set to No.

Using Listener.Add(), you can implement click function on the column's header without having to activate sorting in WebGrid.

Here is the following code:

window.onload = function () {
   var WebGrid1 = ISGetObject("WebGrid1");
   var ColumnHeaderElement = WebGrid1.GetRootTable().GetElement(WG40.COLHEADER, WG40.HTMLTABLE);
   Listener.Add(ColumnHeaderElement, "onclick", DoClick);
}

function DoClick() {
   alert("Implement column click here.");
}
Hope this helps. Thank you.
All times are GMT -5. The time now is 10:35 AM.
Previous Next