|
Ignore this. Typo!
RepeaterItemEventArgs not RepeaterItemEvenArgs.
Click... Shoot....
|
|
|
|
|
|
James,
Thank you also for your reply!
I wanted to know if you could help me through this error? THe following error is generating the following error:
'System.Web.UI.WebControls.ListItemType' is a 'type' but is used like a 'variable'
The code in question:
<br />
<small><br />
public void Customers1_ItemDataBound(Object sender, RepeaterItemEventArgs e) <br />
{<br />
if((e.Item.ItemType = ListItemType)||(e.Item.ItemType = ListItemType.AlternatingItem))<br />
{<br />
Repeater oRPT = (Repeater)e.Item.FindControl("Customer2");<br />
DataRowView oDrv = e.Item.DataItem;<br />
oRPT.DataSource = oDrv.CreateChildView("ItemID");<br />
oRPT.DataBind();<br />
}<br />
}<br />
<br />
public void Customers2_ItemDataBound(Object sender, RepeaterItemEventArgs e)<br />
{<br />
if ((e.Item.ItemType = ListItemType) || (e.Item.ItemType = ListItemType.AlternatingItem))<br />
{<br />
Repeater oRPT = (Repeater)e.Item.FindControl("Customer3");<br />
DataRowView oDrv = e.Item.DataItem;<br />
oRPT.DataSource = oDrv.CreateChildView("ct_number");<br />
oRPT.DataBind();<br />
}<br />
}<br />
</small><br />
Thank you for your help.
Sincerely,
Tim
|
|
|
|
|
The error says that you are using a type as an instance (ie trying to assign values to a CLASS not an INSTANCE of it). Basically, just change the "=" in the if loops to a "=="
This may have been a simple typing mistake (happens to me all the time lol) but just in case:
"=" is the assignment operator, it assigns the value at the right hand side to that on the left.
"==" is a logical operator which tests if the two values are equal (ie if(MyAge == FilmAge))
Hope that helps
|
|
|
|
|
James,
To be honest it was no typing error (just inexperience). I appreciate your additional explaination. It helps me to learn.
UNfortunately though, I am still getting the error. Could there be another reason for this occurance?
Thank you again for your time.
Tim
|
|
|
|
|
James,
What I was able to discover was that if I followed intellisense and used Item instead of LinkItem I was able to get by the error:
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
This however, produced another error which I haven't been able to get by:
Cannot implicitly convert type 'object' to 'System.Data.DataRowView'. An explicit conversion exists (are you missing a cast?)
This is referencing line:
DataRowView oDrv = e.Item.DataItem;
From the following code:
<br />
<small><br />
public void Customers1_ItemDataBound(Object sender, RepeaterItemEventArgs e) <br />
{<br />
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) <br />
{<br />
Repeater oRPT = (Repeater)e.Item.FindControl("Customer2");<br />
DataRowView oDrv = e.Item.DataItem;<br />
oRPT.DataSource = oDrv.CreateChildView("ItemID");<br />
oRPT.DataBind();<br />
}<br />
}<br />
<br />
public void Customers2_ItemDataBound(Object sender, RepeaterItemEventArgs e)<br />
{<br />
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) <br />
{<br />
Repeater oRPT = (Repeater)e.Item.FindControl("Customer3");<br />
DataRowView oDrv = e.Item.DataItem;<br />
oRPT.DataSource = oDrv.CreateChildView("ct_number");<br />
oRPT.DataBind();<br />
}<br />
}<br />
</small><br />
Do you have any thoughts on this?
Thank you for your help. Trying to meet a deadline by morning. Will be here all night if necessary.
Regards,
Tim
|
|
|
|
|
DataRowView oDrv = (System.Data.DataRowView)(e.Item.DataItem);
|
|
|
|
|
Dan,
Thank you very much for your post. You got me past the error!!!
However, although I don't get any errors I still cannot see the nested data within the repeaters.
Some history:
I am attemtping to produce a Repeater that contains 2 nested repeaters that display child data to the parent of the previous. Like this:
Customer Information:
Call Tracking Incident
Comments for each CTI
So the last two repeaters will repeat for as many parent records there are in the parent.
Does this make sense?
It seems that developing single or two tier gridviews or repeaters is not a problem but when you want to expand to mulit-tier repeaters, there is little information on it.
If you have some time could you work me through this? The application is small and probably a sinch for you to troubleshoot.
I don't want to impose on you (but I'm desperate at this point).
If you could give me a few minutes I could post the code.
Sincerely,
Tim
|
|
|
|
|
TMF, if your still on im up for another few hours - my MSN is jamespraveen@aol.com - just add me and we'll talk if you still have any problems
|
|
|
|
|
James,
In the case that you haven't checked email in a bit, I sent you some information concerning the application that might help in diagnosing the problem.
Thank you again for all your help.
Tim
|
|
|
|
|
James,
I didn't hear back from you yesterday after sending the code. Hope all is well.
If you get a chance to look the code I sent today I made a change in it that you'll need to know about.
See below:
The change deals with the pointer to the actual realtionship name instead of the table ID:
From: oRPT.DataSource = oDrv.CreateChildView("ItemID");
To: oRPT.DataSource = oDrv.CreateChildView("HSCTI1");
Unfortunately, I still do not get the child view.
<br />
<small><br />
public void Customers1_ItemDataBound(Object sender, RepeaterItemEventArgs e) <br />
{<br />
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) <br />
{<br />
Repeater oRPT = (Repeater)e.Item.FindControl("Customer2");<br />
DataRowView oDrv = (System.Data.DataRowView)(e.Item.DataItem);<br />
oRPT.DataSource = oDrv.CreateChildView("HSCTI1");<br />
oRPT.DataBind();<br />
}<br />
}<br />
<br />
public void Customers2_ItemDataBound(Object sender, RepeaterItemEventArgs e)<br />
{<br />
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) <br />
{<br />
Repeater oRPT = (Repeater)e.Item.FindControl("Customer3");<br />
DataRowView oDrv = (System.Data.DataRowView)(e.Item.DataItem);<br />
oRPT.DataSource = oDrv.CreateChildView("CTPT1");<br />
oRPT.DataBind();<br />
}<br />
}<br />
</small><br />
Please let me know if you have any suggestions.
Sincerely,
Tim
|
|
|
|
|
Well, i'm quite new to C#, but i wanna learn. So, i've decided to make a program, but i have some dificulties in finding a label that can be set to transparent(only the label, through a transparency key).
The idea is that i have a large picture in the form and that i want to put some labels(or buttons or anything else which has some writing in front and the option to click on it... and, of course can be set to transparent) on the picture so that when you click it, it shows a messagebox.
The basic idea is that i need an object that can stay on top of a picture and be transparent.
p.s.: the idea with cutting the the picture in small sizes which can be set as background won't work because there are many labels...
thank u!
|
|
|
|
|
Only forms can have an opacity key but you can set the label to get its color from an ARGB (Alpha Red Green Blue) value.
|
|
|
|
|
Thanks... I've found an overriden control that does that. And i think it's what i was looking for... Thanks, anyway -> the project name si simple line...
|
|
|
|
|
C# newbie has a simple C# question here:
suppose I have a list in PhotoManager.cs class under /App_Code. In photos.aspx.cs I want to call one item from the list data such as string skname, what should I do? I know if you use dataset you will have something like this: dsCategory.Tables(0).Rows(0).Item("skname") but I don't know how to do it with List. I googled for a while still no luck. BTW, the GetCategory method returns single row of data.
public static List<getcat> GetCategory(){
.....................................
GetCat temp = new GetCat(
(int)reader["skid"],
(string)reader["skname"]);
list.Add(temp);
................
}
I am thinking something like this
string strTemp = PhotoManager.GetCategory.Item("skname")
Obviously this has syntax error. any input is appreciated. thanks a lot in advance!
|
|
|
|
|
I have created my own user control by subclassing UserControl. In the layout of the user control is a standard Button. The Button has its own Click event. How to I programatically raise the Click event of the UserControl when the Button inside is clicked?
Thanks,
Mark
|
|
|
|
|
Inside the UserControl:
private void button1_Click(object sender, EventArgs e)
{
this.onclick(e);
}
|
|
|
|
|
Hi
There is a Usercontrol which is displayed in the modeless state.
Now i display another Usercontrol on top of the the other control and the other control is now completely invisible (it goes behind the new one i have shown now).
The invisible control has a a button control in it and it has a mnemonic set so that upon a particular key press, it will fire its Click event code.
Now when the user is currently working with the new Usercontrol that is displayed on top on the old one (which is currently invisible, but it is there), and hits a key, say "J", the old control's button control's click event gets fired. This is because the key "J" is its mnemonic. How to ensure that when that Usercontrol is not visible, the key down hit is not consumed by the hidden usercontrol's button control. and is used by the one on top - i.e. the new control.
I hav tried all sorts - OnVisibleChanged(), OnLostFocus() etc where i tried to remove hte Click event handler from teh button's click event and adding it when the control becomes visible, etc, but these do not work.
I think the only way to do that is to do something in hidden control's WndProc().
Any ideas?
|
|
|
|
|
Hello,
I have a vb code which l am trying to convert to c# and having many problems with it. PFD = rpt.DataDefinition.ParameterFields.Item("@dt"). In c# there is not a parameterFields method called Item. So i am not sure how do l get the name of my parameter that is in the crystal report viewer.
Can anyone help me convert this code to c#.
<br />
Imports CrystalDecisions.Shared<br />
Imports CrystalDecisions.CrystalReports.Engine<br />
<br />
Dim mDate As DataTime = #01/01/2005#<br />
Dim rpt As New CrystalReport1<br />
Dim PFD As ParameterFieldDefinition<br />
Dim PValues As ParameterValues<br />
Dim Parm As ParameterDiscreteValue<br />
<br />
PValues = New ParameterValues<br />
<br />
PFD = rpt.DataDefinition.ParameterFields.Item("@dt")<br />
Parm = New ParameterDiscreteValue<br />
Parm.Value = mDate<br />
PValues.Add(Parm)<br />
PFD.ApplyCurrentValues(PValues)<br />
<br />
CrystalReportViewer1.ReportSource = rpt<br />
Thanks in advance,
Steve
|
|
|
|
|
try this:
<br />
using CrystalDecisions.Shared;<br />
using CrystalDecisions.CrystalReports.Engine;<br />
<br />
DateTime mDate = DateTime.Parse("01/01/2005");<br />
CrystalReport1 rpt = new CrystalReport1();<br />
ParameterFieldDefinition PFD; <br />
ParameterValues PValues = new ParameterValues();<br />
ParameterDiscreteValue Parm;<br />
<br />
<br />
PFD = rpt.DataDefinition.ParameterFields["@dt"];<br />
Parm = new ParameterDiscreteValue();<br />
Parm.Value = mDate;<br />
PValues.Add(Parm);<br />
PFD.ApplyCurrentValues(PValues);<br />
<br />
CrystalReportViewer1.ReportSource = rpt;<br />
hope it works
|
|
|
|
|
Thanks for all your help.
PFD = rpt.DataDefinition.ParameterFields["dt"];
Have to take out the @ sign of an error message says field name does not exist.
Thanks,
Steve
|
|
|
|
|
Hello everybody .
I am developing chat / Server Application and my project worked will on my localhost and Lan but not on Wan or the internet. I posted this problem at the past and some professional programmers helped me i thank them very very much really i appreciate that from them , I Found that the windows xp has built in firewall i enabled it to access internet users to my server ports manually from my network connection properties. Ok and it works and i chatted with my friends through the internet using my application , But the problem is i need anyone install my messenger on his pc to enable these ports automatically during installation not to make the user manually enable his/her firewall . I know it must have a possible way to do that through win32 send messages function . Is there anyone knows how to send message programmatically to the firewall of windows to enable these ports through code through calling sendmessage , And if there any other methods i appreciate that from you all
Mess With The Best And Die Like The Rest
|
|
|
|
|
If you think about it, a firewall that allows programmatic access to its setup woul be pretty daft! Virus writers could quite easily circumvent the protection of the majority of computer users.
I think the possibility of doing this (at least without local admin rights) is slim to nil.
|
|
|
|
|
|
Hi coders !
I need to binary convert a byte (unsigned 8 bit, 0 to 255) to an
sbyte (signed 8 bit, -128 to 127).
I have no problem converting an array of bytes to any other
type using BitConverter.To[type] functions, but there's no
BitConverter.ToSByte ....
VS 2003 - compact framework SP3
any ideas ?
Ciao
Marco
-- modified at 9:54 Thursday 26th January, 2006
|
|
|
|