|
i have addeded new row but it does not seems so satisfactory(as my requirement is) but bcos as code for generating the new row is in Prerender event
so when u fill the record and click to addnew row button .
then bcos of postback all created row gone and so i dont find myself be able to prevent this
code is
Protected Sub GridView1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.PreRender
Dim GV As GridView = CType(sender, GridView)
Dim intr As Integer = GV.Controls.Count
Dim Tbl As Table = CType(GV.Controls(0), Table)
Tbl.Controls.AddAt(GV.Controls(0).Controls.Count, AddEmptyRow)
'Tbl.Controls.AddAt(GV.Controls(0).Controls.Count, AddEmptyRow)
If a = True Then
Dim i As Integer
For i = 0 To count
Tbl.Controls.AddAt(GV.Controls(0).Controls.Count, AddEmptyRow)
' Tbl.Controls.AddAt(GV.Controls(0).Controls.Count, AddEmptyRow)
Next
End If
End Sub
Function AddEmptyRow() As GridViewRow
Dim GVR As GridViewRow = New GridViewRow(GridView1.Rows.Count, 0, DataControlRowType.EmptyDataRow, DataControlRowState.Insert)
Dim myTableCell As TableCell = New TableCell
For i As Integer = 1 To 3
Dim myHyperLink As TextBox
myHyperLink = New TextBox()
myHyperLink.Width = New Unit(225)
myTableCell.BorderStyle = BorderStyle.Solid
myTableCell.BorderWidth = New Unit(1)
myTableCell.Width = New Unit(700)
myTableCell.BorderColor = Drawing.Color.Black
myTableCell.BackColor = Drawing.Color.MistyRose
myTableCell.Style.Add("text-align", "center")
myTableCell.Controls.Add(myHyperLink)
GVR.Cells.Add(myTableCell)
Next
Return GVR
End Function
Protected Sub b1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles b1.Click
count = count + 1
Dim grsidview As Table = CType(GridView1.FindControl("Tbl"), Table)
GridView1.DataBind()
a = True
End Sub
Raghvendra
|
|
|
|
|
First of all i say thanks to u
i have addeded new row but it does not seems so satisfactory(as my requirement is) but bcos as code for generating the new row is in Prerender event
so when u fill the record and click to addnew row button .
then bcos of postback all created row gone and so i dont find myself be able to prevent this
code is
Protected Sub GridView1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.PreRender
Dim GV As GridView = CType(sender, GridView)
Dim intr As Integer = GV.Controls.Count
Dim Tbl As Table = CType(GV.Controls(0), Table)
Tbl.Controls.AddAt(GV.Controls(0).Controls.Count, AddEmptyRow)
'Tbl.Controls.AddAt(GV.Controls(0).Controls.Count, AddEmptyRow)
If a = True Then
Dim i As Integer
For i = 0 To count
Tbl.Controls.AddAt(GV.Controls(0).Controls.Count, AddEmptyRow)
' Tbl.Controls.AddAt(GV.Controls(0).Controls.Count, AddEmptyRow)
Next
End If
End Sub
Function AddEmptyRow() As GridViewRow
Dim GVR As GridViewRow = New GridViewRow(GridView1.Rows.Count, 0, DataControlRowType.EmptyDataRow, DataControlRowState.Insert)
Dim myTableCell As TableCell = New TableCell
For i As Integer = 1 To 3
Dim myHyperLink As TextBox
myHyperLink = New TextBox()
myHyperLink.Width = New Unit(225)
myTableCell.BorderStyle = BorderStyle.Solid
myTableCell.BorderWidth = New Unit(1)
myTableCell.Width = New Unit(700)
myTableCell.BorderColor = Drawing.Color.Black
myTableCell.BackColor = Drawing.Color.MistyRose
myTableCell.Style.Add("text-align", "center")
myTableCell.Controls.Add(myHyperLink)
GVR.Cells.Add(myTableCell)
Next
Return GVR
End Function
Protected Sub b1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles b1.Click
count = count + 1
Dim grsidview As Table = CType(GridView1.FindControl("Tbl"), Table)
GridView1.DataBind()
a = True
End Sub
Raghvendra
|
|
|
|
|
Member 4659001 wrote: so when u fill the record and click to addnew row button .
then bcos of postback all created row gone and so i dont find myself be able to prevent this
Like I said, AJAX.....
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi,
I'm working as Systems Analyst and working desperately on ASP.NET using c# and MS SQL Server as Backend on a pilot project but now Company Top Level panel asking me to shift the Project in PHP as FE & MySql as BE; please do suggest me is it the Best Option.
Thanks & Regards,
Nizam Quadri
|
|
|
|
|
Nizam Quadri wrote: please do suggest me is it the Best Option.
Tell them to keep it as asp.net
It will be a monsterous job to convert to PHP
|
|
|
|
|
If you want to make it crap, just convert it to VB.NET, no need to go to PHP :P
Seriously, this is a nightmare, tell him to get stuffed. There's no way to do this, apart from starting again and writing it in PHP.
The thing that gets me is that people ask how to do stuff where the obvious thing to ask is why ? I mean, ask the guy why he wants it in PHP, then explain to him why it's a dumb idea. He probably read something on the toilet that convinced him that PHP is cheaper and somehow better for not being microsoft. Which makes him a retard. Your job is to educate him.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian Graus wrote: just convert it to VB.NET,
hey I'm a big fan of VB.NET
The Developer - CEH
|
|
|
|
|
Interesting, did you do VB6 before hand?
modified on Thursday, August 14, 2008 8:44 AM
|
|
|
|
|
The Developer wrote: hey I'm a big fan of VB.NET
Why am I not surprised!
|
|
|
|
|
Hello
I use in my application the calendar tools that came with visuaal studio 2005, it work fine but i can't choose the day we are in, what i mean if we are in 8/14/2008 so i can't choose this date can someone help me
Thanks in advance
Assaf
|
|
|
|
|
|
To connect to what ? How is this about ASP.NET ? How is this a reasonable question to be asking ? Is it for a class ? Is it for your job ? Do you know any C# at all ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hai all,
i had one .aspx page ,in that i have one image(xyz.png) in div tag.
after debugging the image will display as usual in FireFox.but it is not in Internet Explorer?
any one knows...pls help me...
Thanks in advance
Thanks
Subbu.
|
|
|
|
|
The browsers render CSS differently, there is no universal way to correct this you will just have to keep testing both browsers.
Is your code small enough to post?
Put up just your main code and css
|
|
|
|
|
hai ,thank u for u r reply.....
.css
.style5
{
color: #03B0FD
}
Pro Directory
Thanks
Subbu.
|
|
|
|
|
|
Post your message again and check the box at the bottom of the screen:
"Ignore HTML tags in this message (good for code snippets)"
|
|
|
|
|
hai ,thank u for u r reply.....
.css
.style5
{
color: #03B0FD
}
and javascript:
function show(divID) {
document.getElementById(divID).style.visibility = "visible";
}
.aspx:
<a href="javascript:show('prodiv');">Pro Directory</a><br />
<div id="prodiv" style="background-image:url(../Images/signin_holder_1.png);background-color:none;visibility: hidden; width:260; height:251; position:absolute; left: 125px; top: 75px;">
</div>
Thanks
Subbu.
|
|
|
|
|
hai ,thank u for u r reply.....
.css
.style5
{
color: #03B0FD
}
and javascript:
function show(divID) {
document.getElementById(divID).style.visibility = "visible";
}
.aspx:
<pre>
<span class="style5"><a href="javascript:show('prodiv');">Pro Directory</a></span><br />
<div id="prodiv" style="background-image:url(../Images/signin_holder_1.png);background-color:none;visibility: hidden; width:260; height:251; position:absolute; left: 125px; top: 75px;" >
</pre>
Thanks
Subbu.
|
|
|
|
|
Your javascript code you posted doesnt work
|
|
|
|
|
SOLVED
Hi,
I am displaying categories and subcategory for each category in a treeview control. I have displayed checkbox for each subcategory. Now on button click i want to find out which subcategories user has checked (those categories value and text) for that purpose i write following code on button click.
If TreeView1.CheckedNodes.Count > 0 Then<br />
'Display your selected nodes<br />
<br />
For Each node As TreeNode In TreeView1.CheckedNodes<br />
<br />
lblShowMessage.Text += node.Parent.Value & " " & node.Parent.Text & """"<br />
<br />
<br />
Next<br />
<br />
<br />
End If<br />
Please tell me how cani find checked child node.
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
modified on Thursday, August 14, 2008 8:30 AM
|
|
|
|
|
iam using a clob data type in my table where iam sending the data from the multiline text box and now wat query i have to write to get the clob data in my multine text box from the data base.
|
|
|
|
|
javascript function
function DeleteSelected()
{
var a;
var cnt=0;
for (var i = 0; i < CheckBoxIDs.length; i++)
{
a=document.getElementById(CheckBoxIDs[i]);
if(a !=null)
{
if(a.checked==true)
{
cnt=cnt+1;
}
}
}
if(cnt>0)
{
var str = window.confirm('Are you sure you want to PERMANENTLY delete the selected Record(s) ?');
if(str == false)
return false;
else
return true;
}
else
{
var str = window.alert('First Check the records you want to delete');
return false;
}
}
checkbox is declared in datagrid in asp.net using c#
<asp:checkbox id="chkid" runat="server" width="16" xmlns:asp="#unknown" />
and javascript is called from
<asp:imagebutton id="del" imageurl="../images/b_drop.png" border="0" style="cursor: hand" xmlns:asp="#unknown">
Width="16" Height="16" ToolTip="Delete" runat="server" OnClientClick="return DeleteSelected()" OnClick="del_Click"
/></asp:imagebutton>
thanks in advance
I will do my best?
|
|
|
|
|
You're kidding?
Whats the problem?
You cant just post a chunk of code and say thanks in advance.
|
|
|
|
|