|
comp_j wrote: How do am I get selected row's data (Like ID)?
There is a class GridViewRow, on SelectedIndexChnaged event of Grid, Read the current Selected Row in GridViewRow, then you can read each and every column from it. Even you can read directly the data.
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
int ID= Int32.Parse(GridView1.Rows[GridView1.SelectedIndex].Cells[0].Text);
}
Note : I assume, Cell[0] of Grid contain your ID
Hope this will help you
|
|
|
|
|
foreach (GridViewRow gv in gvShowUser.Rows)
{
CheckBox chk = (CheckBox)gv.FindControl("chkEditUser");
if (chk.Checked)
{
//uid = ((Label)gv.FindControl("lblEditUserId")).Text.ToString();
//userid = Convert.ToInt32(uid);
//cnt++;
}
}
|
|
|
|
|
Hi All,
I have a table used to display few items, that table's width is reduced and is using horizontal scroll bar to view all the columns. When that is displayed in IE it is howing the headers properly means the header width is equal to the column width of the items.
when it is viewed in Mozilla or Safari browsers the header widths are reduced but, items column widths are remaining same, which is looking very odd. And when it is viewed completely without horizontal bar in all the browsers the headers widths are good again.
Can anybody please advice me its header widths remain same in all the browsers along with its horizontal bar.
Thanks in advance,
Mohammad Abdul Aleem.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
|
The source is here for the header but
<th class="RowHeader2Cell1" align="left" style="white-space:nowrap;">Asset Name</th>
Thanks,
Mohd Abdul Aleem.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
The problem is IE6 renders scrollbar outside the working area where others renders it inside.
|
|
|
|
|
hello ,
i just want pass the LINQ query in string format from java script to the code behind and then here execute the this string formatted LINQ query.....
public static IList getUserListForGrid(string sQuery)
{
DALDataContext Context = new DALDataContext();
-->i want your help here
->-> Execute sQuery ?????? :omg:
}
|
|
|
|
|
Try assigning value to a server side created hiden field in javascript then get value from codebehind and execute query.
|
|
|
|
|
|
I thought you were asking how to pass a string value with javascript to codebehind.
For executing a string as linq query issue this[^] may help
|
|
|
|
|
Hi,
Can anyone please tell me how to get prompt window in the center of screen?
Thanks
Deepa
|
|
|
|
|
deep7 wrote: Can anyone please tell me how to get prompt window in the center of screen?
You mean Popup window ? In position you are getting right now ? Did you give the top and left position while opening popup window? By default it should be in center.
|
|
|
|
|
No, its not window.open ...its just a prompt window.
I dont have any options for setting it in center like how i can do when normal window.open...for this popup window, we can set it to center, but what about prompt?
document.getElementbyID('hiddencomments') = prompt("Please enter comments here","");
please do help me here.
Thanks
Deepa
|
|
|
|
|
Here it is:
<br />
function PopupCenter(pageURL, title,w,h) {<br />
var left = (screen.width/2)-(w/2);<br />
var top = (screen.height/2)-(h/2);<br />
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);<br />
}
Reference link.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Good Answer !
I have a quick question. I think by default it is in Center. Correct me if I am wrong.
Thanks !
|
|
|
|
|
Thanks Abhijit Jana.
Well,by default IE momorize last location,last position and last window state of window.
If user makes maximize state then close IE window, after re-open it,position and state will be maximized,same go for minimize,normal state and position of IE window.
By using javascript we always can set new position and new state of IE's window.
Regards.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Cool
|
|
|
|
|
Always welcome
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
great
|
|
|
|
|
Thanks.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
|
i have a panel control that i set as dragable with dragdropextender of ajax control. but the problem that i face is on page load this dragable panel gets repositioned to top left corner of page. how to avoid this problem?
|
|
|
|
|
Hello, Ive got a problem with all new sub nodes in a treeview getting multiplied with every postback
--------------------------- (GOOD) before any node check change ---------------
node1
node2
node3
--------------------------- (GOOD) after checking node 1 ---------------
node1
subnode1:113424
subnode2:113424
subnode3:113424
node2
node3
--------------------------- (BAD) after checking node 2 ---------------
node1
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
node2
subnode1:113431
subnode2:113431
subnode3:113431
node3
---------------------------(BAD) after checking node 3 ---------------
node1
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
subnode1:113424
subnode2:113424
subnode3:113424
node2
subnode1:113431
subnode2:113431
subnode3:113431
subnode1:113431
subnode2:113431
subnode3:113431
node3
subnode1:113434
subnode2:113434
------------------- ASP code -----------------------
<body>
<form id="form1" runat="server">
<div>
<asp:PlaceHolder ID="PHForTree" runat=server ></asp:PlaceHolder>
</div>
</form>
</body>
---------------- Code behind --------------
protected void Page_Load(object sender, EventArgs e)
{
TreeView obTreeView = null;
if (IsPostBack == false)
{
obTreeView = new TreeView();
obTreeView.Nodes.Add(new TreeNode("node1"));
obTreeView.Nodes.Add(new TreeNode("node2"));
obTreeView.Nodes.Add(new TreeNode("node3"));
Session["m_obTreeView"] = obTreeView;
}
else
obTreeView = (TreeView)Session["m_obTreeView"];
obTreeView.SelectedNodeChanged += new EventHandler(this.Node_Change);
PHForTree.Controls.Add(obTreeView);
}
void Node_Change(object sender, EventArgs e)
{
TreeView obTreeView = (TreeView)Session["m_obTreeView"];
string strDateTimeStamp = DateTime.Now.ToString("hhmmss");
obTreeView.SelectedNode.ChildNodes.Add(new TreeNode("subnode1:" + strDateTimeStamp));
obTreeView.SelectedNode.ChildNodes.Add(new TreeNode("subnode2:" + strDateTimeStamp));
obTreeView.SelectedNode.ChildNodes.Add(new TreeNode("subnode3:" + strDateTimeStamp));
Session["m_obTreeView"] = obTreeView;
}
I hope someone can help,....
With Regards, Siggi
|
|
|
|
|
Like first clear childnodes before you add them,and you will not get duplicate childnodes.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
No, thats not it.
TreeView obTreeView = (TreeView)Session["m_obTreeView"];
//1//obTreeView.SelectedNode.ChildNodes.Clear();
//2//obTreeView.Nodes.Clear();
string strDateTimeStamp = DateTime.Now.ToString("hhmmss");
line //1// makes no difference
line //2// casts nullreferenceexception
|
|
|
|