User Profile & Activity

Martin Lie Support
martin@intersoftsolutions.com
Page
of 43

Hello,

I have discussed with the developer team about the culture settings. Unfortunately, you cannot have multi cultures in a single WebGrid instance. WebGrid takes account only one culture per instance. Therefore, different WebGrid can have different culture.

However, you are still able to format the column using custom format string. In WebGrid, we provide DataFormatString property in each column. You can customize this property according to your needs.

Thank you.

Posted: December 3, 2010 4:34 AM

Hello,

I have attached a sample file for your reference. In this sample, WebGrid is bound to Customers table using ISDataSource control.

In my case, the code is working. I'm using GetActiveEditCell() method to get the active cell object, and get the edit value afterwards.

function DisplayEdit()
{
   var grid = ISGetObject("WebGrid1");
   var ActiveEditCell = grid.GetActiveEditCell();
   alert(ActiveEditCell.ToCellObject().Value);
}

Hope this helps. Thank you.

Hello Vince,

I think Binding WebGrid to SQL dataset will not produce any error. Do you have any other settings that may cause this error?

Could you provide me a simple sample that replicates your issue? It's easier for me to trace the error.

Thank you.

 

Regards,
-Martin-

Posted: December 2, 2010 5:42 AM

Hello Vincenzo,

Unfortunately, it doesn't happen on my end.

I have attached a simple sample file with AllowAddNew, AllowDelete set to True.

Try to add new row and delete any row, and you will see the column footer gets updated.

If the sampe doesn't help, could you create a simple sample that replicates your issue and send me the sample afterwards in order for me to investigate your issue?

Thank you.

 

Regards,
-Martin-

Hello Vince,

Could you check your project's bin folder whether ISNet.WebUI.WebGrid.Resources.dll is added or not?

If it exists, then could you describe when and how the error occurs on your end? When you said sometime, it means the error doesn't oftenly happen. Therefore, I need to know what scenario that causes the error.

Hope this helps.

Thank you.

 

Regards,
-Martin-

Posted: December 2, 2010 2:30 AM

Hello Vicenzo,

Use the following code to obtain column footer value:

function GetColumnFooter()
{
   var grid = ISGetObject("WebGrid1");
   var colFooterGroupElement = grid.RootTable.GetElement(WG40.COLFOOTERGROUP, WG40.HTMLTABLE);
   var colFooterValue = colFooterGroupElement.parentNode.innerText;
   alert(colFooterValue);
}

What datasource are you using to bind the data? I'm using ISDataSource control to bind Products table into WebGrid, and the total columnfooter gets updated each time I add/delete row.

Hope this helps.

Thank you.

 

Regards,
-Martin-

Posted: December 1, 2010 5:29 AM

Hello Chris,

You need to create a class which inherits UXDesktop, and then override GetContainerForItemOverride() method and return a new UXWindow instead of UXWindowChrome.

I create a class named GetUXWindow.cs and the code looks like following:

public class GetUXWindow : UXDesktop
{
   protected override DependencyObject GetContainerForItemOverride()
   {
      UXWindow newWindow = new UXWindow();
      newWindow.IsClientVisible = true;
      newWindow.CanMaximize = true;
      newWindow.CanMinimize = true;
      newWindow.CanMove = true;
      newWindow.CanResize = true;
      return newWindow;            
   }
}

Declare the new class like following:

<ViewModels:GetUXWindow x:Key="GetUXWindow"/>

Then, replace the UXDesktop control with the class you have created like following:

<ViewModels:GetUXWindow x:Name="uxMyDesktop" DataContext="{Binding Source={StaticResource ContactsViewModel}, Path=Contacts}" 
                             ItemContainerStyleSelector="{StaticResource ContactStackItemStyleSelector}" ItemsSource="{Binding}" 
                             DisplayMemberPath="Contact.Name" ImageMemberPath="Contact.Photo">

        </ViewModels:GetUXWindow>

When you run the project, UXDesktop will create UXWindow objects with its behavior.

Hope this helps.

Thank you.

Posted: November 30, 2010 5:06 AM

Hello Chris,

Please bear with me while I'm investigating your issue. I will let you know the progress.

Thank you.

 

Regards,

-Martin-

Posted: November 30, 2010 4:37 AM

Hello,

Try to use the following code:

function GetTotal()
{
   var grid = ISGetObject("WebGrid1");
   var getTotal = grid.TotalRows;
   var getChangesTotal = grid.RootTable.GetChangesCount();
   alert(getTotal + getChangesTotal);
}

GetChangesCount() method is used to get the changes made in WebGrid. In this case, when you add new row, the total changes will be counted as well by using this method.

Therefore, you will get the total rows along with the added rows.

Hope this helps.

 

Thank you.

Posted: November 26, 2010 4:46 AM

Hello,

I have tried to create your scenario using ItemsSource in UXDesktop. Using a sample data created from Intersoft ClientUI Desktop application template, I have bound a ViewModel with Contacts collection and specified ItemContainerStyle for UXDesktop. Here is the code that I used:

<Intersoft:UXDesktop x:Name="uxMyDesktop" DataContext="{Binding Source={StaticResource ContactsViewModel}, Path=Contacts}" 
                             ItemContainerStyleSelector="{StaticResource ContactStackItemStyleSelector}" ItemsSource="{Binding}" 
                             DisplayMemberPath="Contact.Name" ImageMemberPath="Contact.Photo">
            
        </Intersoft:UXDesktop>

When I run the project with these settings, the UXDesktop will bind the Contacts collection and create UXWindow objects automatically.

Will this code useful for your scenario?

 

Thank you.

All times are GMT -5. The time now is 4:54 AM.
Previous Next