473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Conservar estado control personalizado


Hola a todos:
Estoy intentando hacer un control y necesito mantener el
estado de la siguiente colección que he creado:
public struct ColumnaGrid
{
public string TituloCabecera;
public int LongitudCabecera;
.........
}
[Serializable()]
public class ColeccionColumnasGrid:System.Collections.Collectio nBase
{
public ColumnaGrid Item(int indice)
{
return (ColumnaGrid) List[indice];
}
public void Add(ColumnaGrid objColumnaGrid)
{
List.Add(objColumnaGrid);
}
........}
La estoy intentando guardar en el viewstate pero no hay
forma, uso lo siguiente.
public ColeccionColumnasGrid ColumnasGrid
{
get
{
ColeccionColumnasGrid columnasGrid;
columnasGrid=(ColeccionColumnasGrid) ViewState ["columnasGrid"];
return columnasGrid;
}
set
{
ViewState["columnasGrid"]=value;
}
}
He leido algo de que hay que serializarla pero no se como
hacerlo.
A ver si alguien me puede echar una manita.
Muchas gracias.
..


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
2 2231
Hola!

Well, my Spanish is poor indeed, so if I got it right, you have problems
serializing the ColeccionColumnasGrid collection instance.
You can try searching the MSDN Magazine archives for an Aaron Skonnard's
article on XML serialization. This article, I remember, covered the issues
of serializing collections and hashtables

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Rigoberto Cifuentes" <en****@yahoo.es> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

Hola a todos:
Estoy intentando hacer un control y necesito mantener el
estado de la siguiente colección que he creado:
public struct ColumnaGrid
{
public string TituloCabecera;
public int LongitudCabecera;
.........
}
[Serializable()]
public class ColeccionColumnasGrid:System.Collections.Collectio nBase
{
public ColumnaGrid Item(int indice)
{
return (ColumnaGrid) List[indice];
}
public void Add(ColumnaGrid objColumnaGrid)
{
List.Add(objColumnaGrid);
}
.......}
La estoy intentando guardar en el viewstate pero no hay
forma, uso lo siguiente.
public ColeccionColumnasGrid ColumnasGrid
{
get
{
ColeccionColumnasGrid columnasGrid;
columnasGrid=(ColeccionColumnasGrid) ViewState ["columnasGrid"];
return columnasGrid;
}
set
{
ViewState["columnasGrid"]=value;
}
}
He leido algo de que hay que serializarla pero no se como
hacerlo.
A ver si alguien me puede echar una manita.
Muchas gracias.
.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 16 '05 #2

Thanks a lot.
I must learn ingles.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Greg Christie | last post by:
I think I have a somewhat unique situation here, so I thought I should post it for the few poor souls who run across it and try to google it like I did. First of all, I was getting the following...
6
by: Bruce Rusk | last post by:
I'm using Stephen Lebans' RTF2 control in a report, and have discovered what may be a slight bug in it. I have a lot of non-Western language (Chinese) text in my RTF field, and such records get...
5
by: Paul Mendez | last post by:
I am creating a form with a tab control containing 10 tabs. and what I want to do is on only on of the tabs, I want a sub section of tabs. So what it ends up being is one main tab control with...
0
by: Rafa Guerra | last post by:
Este error lo da al hacer un Mergemail de msword desde msaccess. En mi caso el problema estaba en que yo creaba una barra de herramientas al comenzar la aplicación, y eso sitúa a la base de datos...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
5
by: Hans | last post by:
Hello, I have the following user control called encabezado (I cut some parts of the code to make it shorter): public partial class Encabezado : System.Web.UI.UserControl { private String n;...
1
by: Hans | last post by:
Hello, It looks like my previous post was deleted. So here is again: I have this user control called "encabezado" (I cut the code to make it shorter): public partial class Encabezado :...
1
by: rvidal | last post by:
he estado desarrollando un carrito en ASP.NET 2.0,pero he tenido problemas con el control LOGINVIEW el cual me funcionaba, hasta se me ocurrio correr un antivirus desde entonces no he podido usar el...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.