|
Sir,
Is it possible to create table and any no of rows in table in the edititemtemplate dynamically.
Thank You.
-- modified at 5:56 Friday 14th July, 2006
|
|
|
|
|
yes you need to create class for Itemtemplate which use ITemplate Interface and in that class use Table control as ur template control and you can pass properties of table in constructor when calling template.
hope this will give you idea
Nav.
|
|
|
|
|
can u send me some code for that?
Thanks
|
|
|
|
|
add the class like this in ur code you can modifiy the AddRow function for ur requirments.
public class ItemTemplateTable: ITemplate<br />
{<br />
string tableName;<br />
public ItemTemplateTable(string TableName)<br />
{<br />
this.tableName = TableName;<br />
}<br />
public void InstantiateIn(Control objContainer)<br />
{<br />
Table tbl = new Table();<br />
AddRows(tbl);<br />
objContainer.Controls.Add(tbl);<br />
}<br />
public void AddRows(Table tbl)<br />
{<br />
for (int row = 0; row < 3; row++)<br />
{<br />
TableRow tr = new TableRow();<br />
for (int col = 0; col < 2; col++)<br />
{<br />
TableCell c = new TableCell();<br />
c.Controls.Add(new LiteralControl("row " + row.ToString() + ", cell " + col.ToString()));<br />
tr.Cells.Add(c);<br />
}<br />
tbl.Rows.Add(tr);<br />
}<br />
}<br />
}<br />
TemplateColumn tcl = new TemplateColumn();<br />
tcl.ItemTemplate = new ItemTemplateTable("Test");<br />
DataGrid1.Columns.Add(tcl);
hope every thing will clear now
Nav.
|
|
|
|
|
Can u send the code in vb.net 1.1 Thanks for ur attention
|
|
|
|
|
come on man you just need to change the syntax logic is there.
dont be so lazy...
Nav.
|
|
|
|
|
We have an intranet site where meetings can be booked and displayed online.
Someone has asked if if it possible, some how, when a meeting is added if it could update outlook calanders on certain peoples computers.
Is this possible?
And what would be involved in such a procedure?
Thanks.
|
|
|
|
|
Whom's outlook do you want to update? In outlook you can send an invitation to a meeting to another outlook user. If the receipient click's a button to attend the meeting, then the meeting will be added to the persons recipients calendar in outlook automatically.
If you want to pull the meeting data from your intranet site's database and update Outlook calendar's where needed, I'm sure that is possible as well with the Outlook Integration API[^].
"Half this game is ninety percent mental." - Yogi Berra
If you can read thank a teacher, if you can read in English, thank a Marine.
M y and h don't work so well due to m addiction to caffeine and m in abilit to to set a cup down uprigt.
|
|
|
|
|
Hi,
I am facing a problem in my web application while i am trying to print an html page, whose url is specified in a textbox, using axWebBrowser component. I am getting an error "Exception of type InvalidActiveXStateException was thrown", at axW.Navigate statement. Please help me to rectify this problem.
private void Button1_Click(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
object empty= null;<br />
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(WebForm1));<br />
AxWebBrowser axW=new AxWebBrowser();<br />
axW.Enabled=true;<br />
axW.Visible=false;<br />
axW.OcxState = (System.Windows.Forms.AxHost.State)(resources.GetObject("axW.OcxState"));<br />
axW.Navigate(TextBox1.Text,ref empty,ref empty,ref empty,ref empty);<br />
axW.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER ,ref empty,ref empty);<br />
}<br />
catch(Exception Ex)<br />
{<br />
Response.Write(Ex.Message.ToString());<br />
} <br />
}
This application is a web application and I want the print at the server end since the server is the user in our case.
If it is not possible to print with this control in a web application, Is there any other way to print an html page without loading it and not to show any print dialog at the user end.
Please help me with this case.
Thanks in advance,
Sai.
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
Hi everybody
when i am retrieving the value from database thrgh application an error occured,
'An unhandled exception of type 'System.StackOverflowException' occurred in System.Data.dll'.
please give the solution.
Thanks in Advance.
Regards,
srinandan
|
|
|
|
|
Hi there,
is the function is recursive function? Maybe the code is easier...
<< >>
|
|
|
|
|
Hi, On a site where users log in with username and password. How do I force a logout event to run before the application closes OR BROWSER IS CLOSED? I know about session_end, but that doesnt help when the browser is just closed! I really need to run an event to do a DB query before a user loggs out! Please help.
Regards,
Tintin
|
|
|
|
|
Not sure got your clue...
But if you just want to close the user session, just simple call Session.Abandon()...
<< >>
|
|
|
|
|
There is not sure way to do that.
You can catch the onunload event in the browser, and open a new window that will run a page where you can do your database work. Of course that doesn't work if Javascript is disabled in the browser, or if a popup blocker stops the window.
Unless the browser tells the server that it's closing, there is no way that the server can know when the browser closes. The closest thing that you can get is to have the web page send requests to the server at a certain interval, so that the server can detect when there are not coming any request any more.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa can u please postthe code to check
"send requests to the server at a certain interval, so that the server can detect when there are not coming any request any more"
Is it Submit page through Java Script at certain interval?
|
|
|
|
|
Hi..All,
Can somebody please tell me what is wrong with this ASP.NET page??
The browser is returning me the error
--> SubmitBtn_click is undefined <--
here is the code
......
...
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@Import Namespace="System"%>
<title>Untitled Document
void SubmitBtn_Click(Object Source,EventArgs e)
{
spanMessage.InnerHtml = GetFormattedDate(sugg.Value);
}
public static String GetFormattedDate(string cChoice)
{
string sReturn;
switch(cChoice.ToString())
{
case "0": sReturn=DateTime.Now.ToShortDateString();
break;
case "1": sReturn=DateTime.Now.ToShortTimeString();
break;
case "2": sReturn=DateTime.Now.DayOfWeek.ToString();
break;
case "3": sReturn=DateTime.Now.ToString();
break;
default: sReturn ="None";
break;
}
return sReturn;
}
Short Date
Short Time
Day of the Week
Date and Time
Thankyou.
|
|
|
|
|
You are confusing client side scripting with server side scripting. Your script is running on the server, but the button click event is occuring on the client, as you have not defined the submit button as runat="server"
---
How to get answers to your questions[^]
-- modified at 4:31 Friday 14th July, 2006
|
|
|
|
|
You just create a new web page in Visual Studio, drag-drop a button on the page. And double-click on that button, now you can put your code in the button event handler...
<< >>
|
|
|
|
|
You have excluded most of the error message, so most of the information is missing, like if it's a compile time or runtime error, and where it occurs.
I can't see that you are using "SubmitBtn_click" anywhere in your code, only "SubmitBtn_Click".
---
b { font-weight: normal; }
|
|
|
|
|
Ok guys let me see what I can do....I have gone through the replies from you guys and thanx for your prompt reply, i appreciate it...I will try it out and then update you guys.
|
|
|
|
|
hi to all,
I haver write a code where read a file from one place and write it to another temporary place on server throgh stream and then zip it and download the zip file now i wnat the delete temporary file created within code but this give the error " can't delete because file is used by another process" where as i close my all stream object prperly where that file is use.
give any help is welcome
thanks
|
|
|
|
|
Hello
I am a programmer in asp.net c#.i need ur help .in my project i want to operate with images like enlarging ...my problem is i need a component which manipulate images without destroying it's quality. can any one help me
thanks in advance.
regards alex.
|
|
|
|
|
|
Hello man
Thanks for your help.But it's ok is there any other method that helps me,ie, we just give the height and width according to this figure image will resized without destroying it's quality.
alex.
|
|
|
|