| Dart Home | PowerWEB LiveControls for ASP.NET | Custom Development | Reply | PowerWEB LiveControls for ASP.NET Topics | Forums |
| Author | Forum: PowerWEB LiveControls for ASP.NET Topic: LiveDataGrid and WaitMessage |
| giovanni.gomez ggomez@alum.syracuse.edu From: Orlando, FL USA Posts: 52 Member Since: 07/06/05 |
posted February 12, 2007 10:53 AM Is it possible to use a waitmessage for a livedatagrid? For example, if a user clicks on a sortable column I want the WaitMessage to appear while the datagrid is being sorted. |
K M Drake![]() From: Utica, NY USA Posts: 3406 Member Since: 07/14/00 |
posted February 12, 2007 1:26 PM Hi, Sure. Is it not working for you? Thanks, -ken |
| giovanni.gomez ggomez@alum.syracuse.edu From: Orlando, FL USA Posts: 52 Member Since: 07/06/05 |
posted February 12, 2007 1:55 PM No, it is not working for me. I'm using v.1.6.0.0 Here is my HTML <table> <tr> <td><cc1:LiveLabel ID="lbProcess" runat='server'></cc1:LiveLabel></td> </tr> <tr> <td> <cc1:LiveDataGrid ID="dgTest" runat="server" AutoGenerateColumns="False" DynamicValidation="False" AllowSorting="True" WaitElementID="lbProcess" WaitMessage="Please Wait..."> <Columns> <cc1:LiveBoundColumn DataField="ContactTitle" SortExpression="ContactTitle" HeaderText="Title"></cc1:LiveBoundColumn> <cc1:LiveBoundColumn DataField="ContactName" SortExpression="ContactName" HeaderText="Name"></cc1:LiveBoundColumn> </Columns> </cc1:LiveDataGrid> </td> </tr> </table> My VB Code: Public Enum enuSortOrder soAscending = 0 soDescending = 1 End Enum Private ReadOnly sortExpression() As String = {"ContactTitle", "ContactName"} Private ReadOnly columnTitle() As String = {"ContactTitle", "ContactName"} Private Const VS_CURRENT_SORT_EXPRESSION As String = "currentSortExpression" Private Const VS_CURRENT_SORT_ORDER As String = "currentSortOrder" Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim defaultSortExpression As String Dim defaultSortOrder As enuSortOrder If Not IsPostBack Then defaultSortExpression = sortExpression(0) defaultSortOrder = enuSortOrder.soAscending ViewState(VS_CURRENT_SORT_EXPRESSION) = defaultSortExpression ViewState(VS_CURRENT_SORT_ORDER) = defaultSortOrder Me.bindData(defaultSortExpression, defaultSortOrder) End If End Sub Sub bindData(ByVal sortExpression As String, ByVal sortOrder As enuSortOrder) Dim strSortOrder As String If (sortOrder = enuSortOrder.soAscending) Then strSortOrder = " ASC" Else strSortOrder = " DESC" End If Dim sqlSelect As String = "SELECT CustomerID, ContactTitle, CompanyName, ContactName FROM Customers ORDER BY " & sortExpression & strSortOrder Dim dsData As New DataSet Dim sqlAdapter As New SqlDataAdapter(sqlSelect, ConfigurationManager.ConnectionStrings("NorthwindConnnection").ConnectionString) sqlAdapter.Fill(dsData) Me.dgTest.DataSource = dsData Me.dgTest.DataBind() End Sub Protected Sub dgTest_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles dgTest.SortCommand Dim newSortExpression As String Dim currentSortExpression As String Dim currentSortOrder As enuSortOrder currentSortExpression = CStr(ViewState(VS_CURRENT_SORT_EXPRESSION)) currentSortOrder = CType(ViewState(VS_CURRENT_SORT_ORDER), enuSortOrder) newSortExpression = e.SortExpression If (newSortExpression = currentSortExpression) Then ' Sort column is the same so change the sort order If (currentSortOrder = enuSortOrder.soAscending) Then currentSortOrder = enuSortOrder.soDescending Else currentSortOrder = enuSortOrder.soAscending End If Else ' Sort column is different so eset the new column with ascending sort order currentSortExpression = newSortExpression currentSortOrder = enuSortOrder.soAscending End If ' Update the viewstate with the new sort information ViewState(VS_CURRENT_SORT_EXPRESSION) = currentSortExpression ViewState(VS_CURRENT_SORT_ORDER) = currentSortOrder Me.bindData(currentSortExpression, currentSortOrder) End Sub |
John Talarico![]() From: Rome, NY USA Posts: 630 Member Since: 06/01/05 |
posted February 13, 2007 10:52 AM Giovanni: We have replicated the the problem with the WaitElementID not being affected with a LiveDataGrid. This only appears to be happening with callbacks issued by child controls (e.g. a link or button in a cell), but not on the main grid itself (the rendered HTML table). We've corrected the bug for the next product release. In the meantime, you can add a LocationClick event handler to the LiveDataGrid which does nothing. This will cause a WaitElement to be updated when the grid or child controls are clicked. |
| Reply | PowerWEB LiveControls for ASP.NET Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|