|
ok that should work although i normally set the DataMember Property as well,
so, it must be taht your dataset is not instantiated?
can you post more complete code, including funcitons called from?
my best practice for this is to use the designer to bind to a dataset at design time, then change the reference in Pre_Render() like so:
this.dataset = new DataSet();
this.ultraGrid1.DataSource = this.dataset;
this.ultraGrid1.DataMemeber = "DataTable";
this.ultraGrid1.DataBind();
obviously "DataTable" is the name of the table the band is bound to in the grid.
regs,
g00fy
|
|
|
|
|
Hi, Here is the code . And when i debug, the dataset is getting populated.
The error 'Object reference not set to an instance of an object' pops up at
grid1.DisplayLayout.AutoGenerateColumns = true; line in the code.
Am now having the grid in design time..and am giving this also
<%@ Register TagPrefix="igtbl" Namespace="Infragistics.WebUI.UltraWebGrid" Assembly="Infragistics.WebUI.UltraWebgrid.v2">
Please help.
using Infragistics.WebUI.UltraWebGrid;
using System.Data.SqlClient;
namespace A
{
public class sample : System.Web.UI.Page
{
protected Infragistics.WebUI.UltraWebGrid.UltraWebGrid grid1 ;
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
LoadContent();
}
}
private void LoadContent()
{
string strConnectionString = "data source=abc" +
"Database=Sample;User Id=a;Password=a;";
SqlConnection cnn;
cnn = new SqlConnection(strConnectionString);
try
{
cnn.Open();
}
catch (Exception ex)
{
throw ex;
}
grid1 = new Infragistics.WebUI.UltraWebGrid.UltraWebGrid();
SqlDataAdapter da;
DataSet ds1;
string s = "select * from a";
ds1 = new DataSet();
da = new SqlDataAdapter (s,cnn);
da.Fill(ds1, "Grid");
grid1.DataSource = ds1;
grid1.DisplayLayout.AutoGenerateColumns = true;
grid1.DataBind();
}
private void grid1_InitializeLayout(object sender,LayoutEventArgs e)
{
grid1.Width = System.Web.UI.WebControls.Unit.Pixel(400);
grid1.Height = System.Web.UI.WebControls.Unit.Pixel(400);
grid1.Bands[0].AllowAdd = Infragistics.WebUI.UltraWebGrid.AllowAddNew.No;
grid1.Bands[0].AllowDelete = Infragistics.WebUI.UltraWebGrid.AllowDelete.No;
grid1.DisplayLayout.AllowSortingDefault = AllowSorting.OnClient;
grid1.DisplayLayout.AllowColSizingDefault = Infragistics.WebUI.UltraWebGrid.AllowSizing.Free;
grid1.DisplayLayout.RowSizingDefault = Infragistics.WebUI.UltraWebGrid.AllowSizing.Free;
grid1.DisplayLayout.RowHeightDefault = System.Web.UI.WebControls.Unit.Pixel(22);
grid1.DisplayLayout.HeaderStyleDefault.Height = System.Web.UI.WebControls.Unit.Pixel(20);
grid1.Columns.FromKey("reportTitle").HeaderText = "Report Title";
grid1.Columns.FromKey("reportTitle").Width = System.Web.UI.WebControls.Unit.Pixel(550);
grid1.Columns.FromKey("reportTitle").AllowUpdate = AllowUpdate.No;
grid1.Columns.FromKey("reportName").HeaderText = "Report Title";
grid1.Columns.FromKey("reportName").Width = System.Web.UI.WebControls.Unit.Pixel(550);
grid1.Columns.FromKey("reportName").AllowUpdate = AllowUpdate.No;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void InitializeGridComponent()
{
this.grid1.InitializeLayout += new Infragistics.WebUI.UltraWebGrid.InitializeLayoutEventHandler(this.grid1_InitializeLayout);
//this.grid1.UpdateCellBatch += new Infragistics.WebUI.UltraWebGrid.UpdateCellBatchEventHandler(this.grid1_UpdateCellBatch);
//this.gridDocLink.UpdateCellBatch += new Infragistics.WebUI.UltraWebGrid.UpdateCellBatchEventHandler(this.gridDocLink_UpdateCellBatch);
// this.gridDocLink.DeleteRowBatch += new Infragistics.WebUI.UltraWebGrid.DeleteRowBatchEventHandler(this.gridDocLink_DeleteRowBatch);
// this.gridDocLink.AddRowBatch += new Infragistics.WebUI.UltraWebGrid.AddRowBatchEventHandler(this.gridDocLink_AddRowBatch);
}
}
}
rmr
|
|
|
|
|
Can we design dynamic tabstrip control at runtime without creating tabstrip control at design time? Am trying to do it by adding
%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %> at asp.net design page (.aspx)
and
Microsoft.Web.UI.WebControls.TabStrip tabControl = new Microsoft.Web.UI.WebControls.TabStrip();
at code behind.
Microsoft.Web.UI.WebControls.Tab tab=new Microsoft.Web.UI.WebControls.Tab();
tab.Text= " ok" ;
tab.ID = "1" ;
tabControl.Items.Add(tab);
Am not getting anything on page. Can somebody help???
rmr
|
|
|
|
|
You need to add the control to the Page's Control collection
Page.Controls.Add(tabControl);
regs
g00fy
|
|
|
|
|
Thanks for the reply.
But am not still able to get the tabcontrol. Please help
Design :
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
Code :
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Microsoft.Web.UI.WebControls.TabStrip tabControl = new Microsoft.Web.UI.WebControls.TabStrip();
Microsoft.Web.UI.WebControls.Tab tab=new Microsoft.Web.UI.WebControls.Tab();
tab.Text= " ok" ;
tab.ID = "1" ;
tabControl.Items.Add(tab);
Page.Controls.Add(tabControl);
}
-- modified at 10:20 Wednesday 6th September, 2006
rmr
|
|
|
|
|
ok i don't have that assembly and have never used it but this code works
protected void Page_Load(object sender, EventArgs e)
{
Table table = new Table();
table.Rows.Add(new TableRow());
table.Rows[0].Cells.Add(new TableCell());
table.Rows[0].Cells[0].Controls.Add(new LiteralControl("cell 0"));
Page.Controls.Add(table);
}
and this code doesn't work
protected void Page_Load(object sender, EventArgs e)
{
Table table = new Table();
table.Rows.Add(new TableRow());
table.Rows[0].Cells.Add(new TableCell());
table.Rows[0].Cells[0].Controls.Add(new LiteralControl("cell 0"));
}
hope that helps
g00fy
|
|
|
|
|
Hi Guys;
Here is the problem.
Im trying to Authenticate a user to my site but the function
User.Identity.IsAuthenticated always returns false
what could be the problem.
I also checked the web.config file with another project of mine which works fine there were no differences!!
Thanks in advance
Riazi
|
|
|
|
|
do you have authentication and roles and proviers set up in web.config?
do you have permission set up in web.config?
can you post your web.config?
regards,
g00fy
|
|
|
|
|
User.Identity works when you have passport credentials
a easy solution is to make a manual authentication of the user ID y password against to database, in true case you must to let pass the user, use the sentence e.Authenticated = true;
My project made that basic authentication, here the example
Logeo is the control's Login name
protected void Logeo_Authenticate(object sender, AuthenticateEventArgs e)
{
if ((Logeo.UserName == "a") && (Logeo.Password == "b"))
{
Mensaje.Text = "Welcome aboard";
e.Authenticated = true;
}
}
Keep Learning...
ff
|
|
|
|
|
britneyssssers wrote: User.Identity works when you have passport credentials
It is not only for Passport. Windows authentication also uses this. In fact I've never built a site that uses Passport authentication. Has anyone else? (I'm curous)
britneyssssers wrote: a easy solution is to make a manual authentication of the user ID y password against to database
An easy solution would be to use the built in functionality provided by the asp.net framework and add entries in the web.config to authenticate against. This is much easier than creating a database, tables and proceduces and the necessary overhead to use it.
only two letters away from being an asset
|
|
|
|
|
Hi all,
Any body know GOF Design patterns
Softy Boy
|
|
|
|
|
softy_boy wrote: Any body know GOF Design patterns
Yes.
|
|
|
|
|
lol colin,
yep me too.
g00fy
|
|
|
|
|
Yep, and a few others, like the Rube Goldberg pattern used by the last client.
only two letters away from being an asset
|
|
|
|
|
pls tell me on my mail id
g_parwez@rediffmail.com
g_parwez@yahoo.com
Softy Boy
|
|
|
|
|
Hi Friends,
I m using 1 session variable like this
Session["fullname"]="ABC";
then I pass this value to a class let say in which the FullName Property is declared with Public static key words
SessionInfo.FullName=Session[""].ToString();
It works fine for one user
but when i run two sessions what happens is
if Mr. "A" is already logged on the web site and after Mr. "A", Mr."B" logs in.
the name of Mr."A" changes to Mr."B" and on both browswer windows now name is Mr."B".
Would you please help me , where i am wrong?
Please if you do not understand my problem, do ask me.
thansk
Naveed Kamboh
|
|
|
|
|
the property is static, that is the problem
why do you not just access the session var, rather than store it in another class?
else you will need to get complicated, if you want to keep the property static and keep an IDictionary<sessionId, propertyValue> in the object and return the appropriate value for the users session.
other option, *cleaner* than static property, but less clean that just accessing session var, is to create an instance object for each session like.
new SessionInfo().FullName = Session["fullname"] as String;
hope this helps
g00fy
|
|
|
|
|
How can I change the color and style of an asp.net form?
Regards,
Thomas
|
|
|
|
|
|
How can I make an multilanguge application in asp.net ?
,,,,,,,,,,,,,,,,,,.................,,,,,,,,,,,,
|
|
|
|
|
|
|
Hi *.*,
I've got a user-control with 3 Dropdowns, A, B and C. If the user selects something in A, the content of B should change depending on the value selected in A. I sure could do that by reposting the page on every selection change. What I'd rather do is to send all possible values wrapped up in some javascript to the client. Can somebody give me a starting point on how to cope with this?
-> How do I attach Javascript to the Dropdowns change event?
-> How to send all values to the client?
thanks in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
i would use ajax for this, if this is not possible then look here,
http://javascriptkit.com/script/script2/multiplecombo.shtml
plenty of e.g's on that site
hope that helps,
g00fy
|
|
|
|
|
I am having a problem with a asp:menu 2.0 control. When I set up the control to use an XmlDataSource the postback event doesn't fire for all the menu items. i.e. I have a OnMenuItemClick event, but it only fires for the items under the first menu entry. Here is the aspx markup:
<asp:Menu ID="mnuMain" runat="server" Orientation="Horizontal" OnMenuItemClick="mnuMain_MenuItemClick" DataSourceID="xmldsMenu">
<DataBindings>
<asp:MenuItemBinding DataMember="MenuNode" NavigateUrlField="url" TextField="title" ValueField="value" />
<asp:MenuItemBinding DataMember="MenuNode" NavigateUrlField="url" TextField="title" ValueField="value" />
</DataBindings>
</asp:Menu>
<asp:XmlDataSource ID="xmldsMenu" runat="server" DataFile="menu.xml" XPath="/MapHomeNode/MenuNode">
</asp:XmlDataSource>
-- modified at 7:15 Wednesday 6th September, 2006
|
|
|
|