|
Eh...? You didn't read my previous post, you just replied to it anyway?
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
hello there,
i have 2 nested datalist, and i cant call the inner one.
i just want to access its' controls (textbox, ets) from the code behind.
Here is the aspx page and followed by the aspx.vb page:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="testing.aspx.vb" Inherits="testing" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" type="text/javascript">
// <!CDATA[
// ]]>
</script>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:bschutzConnectionString %>"
SelectCommand="SELECT [fold_id], [folder_name], [commid] FROM [folders]"></asp:SqlDataSource>
<asp:DataList ID="DataList1" runat="server" BackColor="#DEBA84" BorderColor="#DEBA84"
BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" DataSourceID="SqlDataSource1"
GridLines="Both" Width="527px">
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<ItemTemplate>
<table id="TABLE1" onclick="return TABLE1_onclick()">
<tr>
<td style="width: 100px; height: 21px;">
folder Id:&nbsp;</td>
<td style="width: 291px; height: 21px;">
<asp:Label ID="fold_idLabel" runat="server" Text='<%# Eval("fold_id") %>'></asp:Label></td>
<td style="width: 410px; height: 21px;">
</td>
</tr>
<tr>
<td style="width: 100px; text-align: left;">
folder Name:</td>
<td style="width: 291px">
<asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Eval("folder_name", "{0}") %>' OnClick="LinkButton1_Click"></asp:LinkButton></td>
<td style="width: 410px; text-align: right;">
<asp:LinkButton ID="LinkButton2" Text="Edit" CommandName= "Edit" runat="server"></asp:LinkButton></td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 291px">
</td>
<td style="width: 410px">
</td>
</tr>
</table>
<br />
<asp:DataList ID="DataList2" runat="server" BackColor="LightGoldenrodYellow" BorderColor="Tan"
BorderWidth="1px" CellPadding="2" DataKeyField="id" DataSourceID="SqlDataSource1"
ForeColor="Black" Width="821px">
<FooterStyle BackColor="Tan" />
<SelectedItemStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<ItemTemplate>
&nbsp;<br />
<table>
<tr>
<td style="width: 100px">
foled id:</td>
<td style="width: 100px">
<asp:Label ID="folidLabel" runat="server" Text='<%# Eval("folid") %>'></asp:Label></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
File Id:&nbsp;
</td>
<td style="width: 100px">
<asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>'></asp:Label></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
File Subject:
</td>
<td style="width: 100px">
<asp:Label ID="subjectLabel" runat="server" Text='<%# Eval("subject") %>'></asp:Label></td>
<td style="width: 100px">
</td>
</tr>
</table>
<br />
<br />
<br />
</ItemTemplate>
<AlternatingItemStyle BackColor="PaleGoldenrod" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
</asp:DataList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:bschutzConnectionString %>"
SelectCommand="SELECT [folid], [id], [subject] FROM [minutes] WHERE ([folid] = @folid)">
<SelectParameters>
<asp:ControlParameter ControlID="HiddenField1" Name="folid" PropertyName="Value"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("fold_id", "{0}") %>' />
<br />
</ItemTemplate>
<ItemStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<EditItemTemplate>
<table>
<tr>
<td style="width: 100px; height: 21px">
Folder Name</td>
<td style="width: 100px; height: 21px">
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("folder_name", "{0}") %>'></asp:TextBox></td>
<td style="width: 100px; height: 21px">
<asp:LinkButton ID="LinkButton3" Text="cancel" CommandName="Cancel" runat="server"></asp:LinkButton></td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
</table>
</EditItemTemplate>
</asp:DataList>&nbsp;
</asp:Content>
this is the ASPX.VB
Partial Class testing
Inherits System.Web.UI.Page
Protected Sub DataList1_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.EditCommand
DataList1.SelectedIndex = e.Item.ItemIndex
DataList1.EditItemIndex = e.Item.ItemIndex
DataList1.DataBind()
End Sub
Protected Sub DataList1_CancelCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.CancelCommand
DataList1.SelectedIndex = -1
DataList1.EditItemIndex = -1
DataList1.DataBind()
End Sub
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim dtl2 As DataListItem = (DataList1.FindControl("Datalist2"))
dtl2.Visible = False
End Sub
End Class
the ERROR page
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 18: Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Line 19: Dim dtl2 As DataListItem = (DataList1.FindControl("Datalist2"))
Line 20: dtl2.Visible = False
Line 21: End Sub
Line 22: End Class
Thanks in advance
Edward Topalian
|
|
|
|
|
Hello there i got the Answer to this question.\
it is:
Dim but As LinkButton = sender ' linkbutton that i'm calling from.
Dim sl1 As DataListItem = but.NamingContainer
sl1.FindControl("DataList2").Visible = False
'Datalist2 is the child datalist.
'so this way i can call anyitem in the chinld datalist
|
|
|
|
|
Hi all,
I'm Beginner in VB .Net,now i'm havng 10 Forms in my project
named as form1,form2,form3 etc,.
How to change the name of that form,and wat r the changes, we need to do ,if we change the name of a form,,
Any one plz help me in this regard,,,,
Thanks in advance
Saravana...
|
|
|
|
|
In the solution explorer click on the form and then click it again (like windows explorer) so that you can rename it. When You rename the file it should automatically rename the form class itself. Compile after each rename to ensure that the application still compiles. If the application doesn't compile then the form renaming process won't work properly.
|
|
|
|
|
Hi Friend,
Colin is right, another thing is to buy a Book in Introduction to Vb.net, i thik you are starting Programming in VB.NT you dont have never developed in vb6, but buy a book and google for vb.net free e-books. it will help you.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Please help!!
How can i preview single/multipage images on a form?
|
|
|
|
|
I have a Combo Box control and during runtime I want to remove some of the Items in it according some conditions. How can I achieve this ?
I wrote the code for this
ComboBox1.Items.Remove(Index)
ComboBox1.Refresh()
But this doesnt works and still the item is there after running the code.
Could anybody please suggest what is the correct code.
Thanks.
|
|
|
|
|
use this property
combobox1.items.clear()
might it work
|
|
|
|
|
Thanks Ravi for your reply.
The code you have supplied clears all the items in the ComboBox. I wanted to remove a particular item depending on the condition i have. I found the correct code for this and it is :
ComboBox1.Items.RemoveAt(index)
Thanks for your response.
Sekhar
|
|
|
|
|
Can you you halp me wiht my assignment???..
1. Create a folder that i
can rename, delete, save and delete images
vashstampede
|
|
|
|
|
System.IO.Directory.CreateDirectory("c:\RTFM")
|
|
|
|
|
Ashfield wrote: System.IO.Directory.CreateDirectory("c:\RTFM")
Read This Fine Message?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
"SOS!" help...... Please give me codes on how to connect an image scanner??
|
|
|
|
|
how can i give the expiration date in my visual studio setup and deployment project which is build in vb.net
|
|
|
|
|
Explain in Detail what you want to do
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I have a DataGridView control in a PC Project. I want tooltips to appear in the cells of a specific column...these tooltips will be different for each row. I currently using this code:
dgvMyGrid.ShowCellToolTips = True
dgvMyGrid.Columns("MyColumn").ToolTipText = "Test HeaderCell Tooltip"
For Each dgvr As DataGridViewRow In dgvMyGrid.Rows
dgvr.Cells("MyColumn").ToolTipText = "Test Cell Tooltip " & dgvr.Index
Next
I am able to see the Test HeaderCell Tooltip when I hover over the headercell in the column, but the tooltips in the cells of the grid are not showing up. Is there another setting I'm missing or something? Anyone got any ideas?
|
|
|
|
|
I finally figured out why it's not working. To make my form look nicer, I set my grid's visiblity to false in design, and then set it to true once the entire form has loaded. However, there are certain settings on the grid that just don't seem to take effect if the grid is currently not visible. I guess tooltips is one of those items. (Other ones I've found are fonts/colors/etc.) So I guess I will have to loop through the grid again after I've set the grid's visiblity to true, unless someone else has a workaround for this issue???
|
|
|
|
|
Hello everyone,
I have developed code using Visual Basic in visual studio 2005.
It runs fine when i run it.
Now i want to publish it on the www web.
Could anyone please help me out how to do that?
thank you
|
|
|
|
|
the www web ?
The obvious way is to put it in a zip, and give people a link to the .NET framework.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: www web ?
Hmmmm, that's a new one
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I want to put my question in a more appropriate way.
I am really sorry for the way i put my question.
I am really new to the programming world.
So please pardon me.
I want to deploy it on the web and the user have to open it on the browser like explorer. Its basically a game sort of thing. I want the user to play the game directly on the web browser.
Could any one help me out on this?
Thanking you.
|
|
|
|
|
Hi
I need to save an Excel file as (Excel 97-2003)
For the code below, I have a reference to Microsoft Excel 12.0 Object Library, which I assume is for Excel 2007.
When I open a workbook saved as below, I get an error message saying the workbook is not in the expected format.
Previously I used a reference to Excel 10.0 which worked fine, but I cannot find that anymore when adding references.
I guess I have two choices:
a) How do I reference Excel 10.0 Object Library?
or
b) In the code below, what do I replace "FileFormat As Object" with to specify that the file must be saved as an older Version?
Private Sub ExportExcel()<br />
Dim xlApp As New Excel.Application<br />
Dim xlBook As Excel.Workbook<br />
xlBook = xlApp.Workbooks.Add<br />
<br />
'Write stuff to book here...<br />
<br />
xlBook.SaveAs("MyBook.xls", "FileFormat As Object")<br />
xlBook.Close()<br />
xlBook = Nothing<br />
xlApp.Quit()<br />
xlApp = Nothing<br />
GC.Collect()<br />
End Sub
|
|
|
|
|
Found my answer...
Use one of the Interop.Excel.XlFileFormat formats
Interop.Excel.XlFileFormat.xlExcel8 seems to work fine
|
|
|
|
|
Hi,
As the title says, How do I create, use and interact with windows services in VB.NET 2005?
Links, examples, tips , tutorials.. all welcome.
Thanks!
|
|
|
|