|
Hi,
You can use the code in the code behind:
<br />
for (int i = 0; i < TableID.Rows.Count; i++)<br />
{<br />
CheckBox chk = (CheckBox)TableID.Rows[i].FindControl("CheckBoxId");<br />
if(chk.Checked)<br />
else<br />
<br />
}<br />
I hope it help for you
|
|
|
|
|
Need help... When I do comparison betwen a cell contents of the grid and and arraylist I need to disable that particular row in the grid.... Is it possible...
for (int i = 0; i < mylist.Count - 1; i++)
{
foreach (GridViewRow row in grdSelectClient.Rows)
{
if( row.Cells[5].Text.ToString() == mylist[i].ToString())
{
//Code for disabling the row when comparison is equal....
}
}
}
-- modified at 6:32 Monday 7th May, 2007
-- modified at 6:34 Monday 7th May, 2007
|
|
|
|
|
Hi,
I hope you have got the solution by this time but still I suggest you to write the following code inside the "if" block in your code
row.Enabled = false;
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
I had to generate a Word Report with password.
Upon the request from the clients the application will create a Word Report at the server(where Word 2000 is installed) closed that file, exported the same to the client system. After that the file is deleted from the server.
But in some client system some gif files were not getting loaded(There also it was using Word 2000). Actually i tested from 5 to 6 machines which have been installed Word 2000. It was getting loaded at some and not at the other.
But it was also not getting loaded at the systems where Word 2003 is also installed.
But whatever the client is the file is generated correctly at the server before it is exported. I have checked that by commenting the code that deletes the file at the server.
Please help....
-- modified at 6:28 Tuesday 8th May, 2007
O
|
|
|
|
|
Hello,
I want to capture webcam image from ASP.Net application using C#. Client should access my ASP.Net page which should be able to access the webcam image from client's browser and upload on my web server.
Please respond it immediately.
Jitendra
|
|
|
|
|
hi,
i want to import excel sheet datas into mysql table using C# code. anybody please help me with proper code.
Regards
Vijay.
|
|
|
|
|
i think i had replied u before with proper code... u better check ur last 3-4 posts where u asked the same question.
|
|
|
|
|
thanks vaibhav,
but the thing is that i need only the code to upload the excel datas into the database without using datagrid. bcoz i'm not using datagrid in my application and i don't use stored procedure as the application is already a running project in which i have to add a small part. i hope u got my idea. i need only the code for importing datas into mysql table. pls help me..
Regards
Vijay.
|
|
|
|
|
I get the keycode from keyboard in IE, by using window.event.Keycode
But same fails in Mozilla ,how can I detect Keycode in Mozilaa.
Thanks In advance
Navneet Hegde
Nashik.
Develop2Program & Program2Develop
|
|
|
|
|
The window.event object only exists in IE. In Mozilla the event object is sent as a parameter to the function.
---
single minded; short sighted; long gone;
|
|
|
|
|
Pleasure having your words , Now its working well even on Opera.
Thanks
Navneet Hegde
Nashik
Develop2Program & Program2Develop
|
|
|
|
|
Hi all,
i need to invoke a function, when the user clicks the left button of the mouse, inside a textbox. i am using asp.net 2.0 with c#.
can anybody help me.
Thanks in advance
Sebastian
|
|
|
|
|
hi,
It is possible to track click event of textbox in javascript.
but in C# textbox doesnt have click event. So you can not create eventhandler for that.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Ok. i can use vb also. can you say how to implement this.
Many Thanks for reply
sebastian
|
|
|
|
|
Hi,
R u Developing webapplication or windowsapplication?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
its a webapplication
thanks
sebastian
|
|
|
|
|
why do you want to handle click on textbox?
<< >>
|
|
|
|
|
i need to dispaly some thing in text box when user clicks in the textbox.
thanks
sebastian
|
|
|
|
|
ohh...for this...just use onfocus js event to handle this...
<< >>
|
|
|
|
|
i tried it out just now, but didn't got any results.
do you have any code snippet to help me?.
thanks
sebastian
|
|
|
|
|
|
|
Hi Everybody,
Sorry for the very basic question, I'm totally new to ASP.NET. My task is to write a simple user control to be talking with SharePoint. The problem I have is understanding communication with the Datagrid. At hte moment where I think I must be geeting the contents of the cells on grid I'm getting Argument.Out.OfRAnge Exception. I'm obviously doing something wrong, but my Win-form experience doesn't tell me what. Any help is very much appreciated. Thanks
In the following code I'm able to display the contents of the DataTable, then add a new row to the table, display it. But when I click on the "update" button on the grid to display the contents of the cells in Labels, "Index Out of range"exception is thrown.
Code:
private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
Fill();
Bind();
}
}
#region Bind
private void Fill()
{
fieldList = new ArrayList();
fieldList.Add("Field1");
fieldList.Add("Field2");
missGridTable = new DataTable();
string error = string.Empty;
SPCom sp = new SPCom();
missGridTable = sp.BindWithFieldList(web,"Test List",fieldList,error); //this succesfully populates the datatable
}
private void Bind()
{
missionGrid.DataSource = missGridTable;
missionGrid.AutoGenerateColumns=false;
missionGrid.DataBind();
foreach(DataColumn c in missGridTable.Columns)
{
missionGrid.Columns.Add(CreateBoundColumn(c));
}
missionGrid.DataBind();
}
private BoundColumn CreateBoundColumn(DataColumn c)
{
BoundColumn column = new BoundColumn();
column.DataField = c.ColumnName;
column.HeaderText = c.ColumnName.Replace("_"," ");
column.DataFormatString ="";
return column;
}
#endregion Bind
private void InsertEmpty()
{
missGridTable.Rows.InsertAt(missGridTable.NewRow(), 0);
}
private void add_Click(object sender, System.EventArgs e)
{
try
{ // inserting
missionGrid.EditItemIndex = 0;
// modify text
EditCommandColumn ecc =
(EditCommandColumn) missionGrid.Columns[0];
ecc.UpdateText = "Insert";
// fill table, insert empty row, bind to datagrid
Fill();
InsertEmpty();
Bind();
}
catch (Exception Ex)
{
Label1.Text = Ex.ToString();
}
}
# region grid click parser
private void grid_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
// stop editing
missionGrid.EditItemIndex = -1;
switch (e.CommandName)
{
case "Update": // this causes an exception
{
try
{
TableCell cellField1 = e.Item.Cells[1];
TableCell cellField2 = e.Item.Cells[2];
string field1 = cellField1.Text;
string field2 = cellField2.Text;
Label1.Text = "-----" + field2;
Label1.Text = "asasdsadasd";
}
catch (Exception ex)
{
Label1.Text = ex.ToString();
}
|
|
|
|
|
HI,
Exactly where you get the error?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Hi,
I'm getting an error here, when I'm trying to access the fields in the DataGrid
The exception is index out of range
try
{
TableCell cellField1 = e.Item.Cells[1];
TableCell cellField2 = e.Item.Cells[2];
string field1 = cellField1.Text;
string field2 = cellField2.Text;
Label1.Text = "-----" + field2;
}
thanks
-- modified at 6:55 Monday 7th May, 2007
|
|
|
|