Hi there!
Can you please tell me why the WebGrid reloads ONCE ( the first time ) when I push the [+] to get the children for parent row ? This only happens ONCE ... and after I that I try other [+] and it works like a charm WITHOUT refreshing the Grid ?? The [+]'s are always rembered as opened for each line ( which is good )
rgd,EE.
This is the code for the Grid:
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
IsIt.Tracking.Service;
IsIt.Tracking.DataTypes;
IsIt.Tracking.Utils;
System.DirectoryServices.AccountManagement;
//using KBBanki.Common;
namespace
IsIt.Tracking
{
Page
> _transactions;
> _transactionsOneToMany;
e)
(!Page.IsPostBack)
System.Security.Principal.
.GetCurrent();
(identity);
))
//creates an entry for LogViewer
Response.Redirect(
);
}
//_ugTransactions.DisplayLayout.LoadOnDemand = Infragistics.WebUI.UltraWebGrid.LoadOnDemand.Automatic;
//_ugTransactions.EnableViewState = false;
_ugTransactions.DisplayLayout.ViewType = Infragistics.WebUI.UltraWebGrid.
.Hierarchical;
//_ugTransactions.Browser = Infragistics.WebUI.UltraWebGrid.BrowserLevel.Auto;
//_ugTransactions.DisplayLayout.Pager.AllowPaging = true;
//_ugTransactions.DisplayLayout.Pager.PageSize = 100;
/*_tbBankanumer.Text = "0329";
_tbHofudbok.Text = "26";
_tbReikningur.Text = "456998";*/
.Empty))
_lblBankanumerHofudbokReikningur.Text =
;
//1/1/1753 12:00:00 AM and 12/31/9999
(1753, 1, 1);
(9999, 12, 31);
bankanumer = _tbBankanumer.Text.Trim();
(bankanumer.Length == 3)
bankanumer =
+ bankanumer;
hofudbok = _tbHofudbok.Text.Trim();
reikningsnumer = _tbReikningur.Text.Trim();
)
dagsFra = (
)_dateDagsetningFra.Value;
dagsTil = (
)_dateDagsetningTil.Value;
try
_transactions =
.GetAllAKTransactionTracksBySearchCriteria(bankanumer, hofudbok, reikningsnumer, dagsFra, dagsTil);
ex)
//Exceeds the maximum rows able to databind:
_lblBankanumerHofudbokReikningur.Text = ex.Message;
_ugTransactions.Rows.Clear();
_lblRows.Text =
_lblRowCount.Text = _ugTransactions.Rows.Count.ToString();
.LogIntoDatabase(logger);
Cache.Remove(
Cache[
] = _transactions;
(_transactions.Count > 0)
_ugTransactions.DataSource = _transactions;
_ugTransactions.DataBind();
//this will throw 'System.OutOfMemoryException' !!!!!
.LogIntoDatabase(log);
.Empty;
UltraWebGridExcelExporter1.ExportMode = Infragistics.WebUI.UltraWebGrid.ExcelExport.
.Download;
_transactions = (
];
.Empty)
UltraWebGridExcelExporter1.Export(_ugTransactions);
else
typeOfOperation)
();
log.Bankanumer = _tbBankanumer.Text.Trim();
log.Hofudbok = _tbHofudbok.Text;
//KBBanki.Common.UserDetails userInfo = new UserDetails(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
//log.FullName = userInfo.FullName;
log.LoginId = identity.Name;
log.RecordsCount =
.Parse(_lblRowCount.Text);
log.Reikningsnumer = _tbReikningur.Text.Trim();
log.TypeOfOperation = typeOfOperation;
log.DagsetningFra = dagsFra;
log.DagsetningTil = dagsTil;
log.GridName = gridName;
log;
e.Layout.Bands[0].AllowSorting = Infragistics.WebUI.UltraWebGrid.
.OnClient;
e.Layout.Bands[0].AllowColSizing = Infragistics.WebUI.UltraWebGrid.
.Fixed;
e.Layout.Bands[0].AllowColumnMoving = Infragistics.WebUI.UltraWebGrid.
.None;
e.Layout.Bands[0].Columns.FromKey(
).Width = 50;
).Width = 20;
).Width = 60;
//Mtnafn
).Move(0);
).Move(1);
).Move(2);
).Move(3);
).Move(4);
).Move(5);
).Move(6);
).Move(7);
).Move(8);
).Move(9);
).Move(10);
).Move(11);
).Move(12);
).Move(13);
).Move(14);
).Move(15);
).Move(16);
).Move(17);
).Move(18);
).Move(19);
).Move(20);
).Move(21);
).Move(22);
).Move(23);
e.Layout.Bands[1].Columns.FromKey(
){};
//e.Layout.Bands[1].Columns.FromKey("Gjaldkeri").Hidden this property is false at run time, as it should be!
//e.Layout.Bands[1].Columns.FromKey("Gjaldkeri").Visible this property is TRUE, as it should be ... although it's not displaying
EE,
What is the value of your grid's DisplayLayout.LoadOnDemand property? The behavior you're describing is correct behavior if this property is set to "Automatic".
I notice that you have a commented-out setting of this property:
eiki666 said://_ugTransactions.DisplayLayout.LoadOnDemand = Infragistics.WebUI.UltraWebGrid.LoadOnDemand.Automatic;
What do you want this to be ? I **DON'T** want the Grid to re-post the first time I push the [+] to dig for the children ... is this possible ?
I've got around this problem ( sort of ) by opening up all the parents right in the InitilizeRow( I check if it's a parent row ... and if it is, I expand it ) But this is NOT my preferred way ... I'm only doing this to get rid of the post-back on FIRST open of parent/child.rgd,EE