|
Hi I am using this treeview in web browser populated via a database.
when i select a node i pass a url parameter and filter a datagrid on the right hand side of same page.
eg.
---
nodeAutoCat.NavigateUrl = "Index.aspx?CatId=" + Server.UrlEncode(CType(rowAutoCat("CatId"), String))
---
but i cant maintain the view state of treeview it collaspe everytime i do postback.
can some body help me how to retain the state of treeview upon postback
cheers
PS: I am using visual studio 1.1 and database is sql server 2000
|
|
|
|
|
Does anyone have an idea what i am talking about or its not clear? Or it is not a good idea to used treeweb control. in aspx the tag looks like
<iewc:treeview id="TreeView1" runat="server" target="_self">
have some one faced similar problem and fixed it?
|
|
|
|
|
Is there no EnableViewState property in the treeview control for .NET 1.1? There should be, most controls do.
You may be to accomplish it using query strings or cookies (session variables would be overkill I think) & manipulating these methods at PageLoad. I hope these methods exist for the .NET 1.1 treeview. They really should.
treeview.FindNode("NewNode/NewNode").Expand()'node path
treeview.Nodes.Item(i).Expand()'node index
treeview.SelectedNode.Expand()
|
|
|
|
|
there is no method called FindNode under treeview web control and under my treeview web controls property i have set enableviewstate to true.
Please help here are my codes. when i navigate i just want to maintain the state of the treeview control
---
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
objConn = New SqlConnection(dbPath)
Dim value As String
value = Request.QueryString("CatId")
If value <> Nothing Then
Dim dsProducts As New DataSet
cmd = New SqlCommand("SELECT vehId, vehName, vehImgRef from vehicle where catId ='" + value.ToString + "'", objConn)
Dim daAuto As New SqlDataAdapter(cmd)
daAuto.Fill(dsProducts)
dgProducts.DataSource = dsProducts
dgProducts.DataBind()
End If
If Not IsPostBack Then
Dim objDS As New DataSet
Dim daAutoType As New SqlDataAdapter("SELECT AutoId,AutoType FROM AutoType", objConn)
Dim daAutoCat As New SqlDataAdapter("SELECT AutoId,CatId, CatName FROM Category", objConn)
daAutoType.Fill(objDS, "dtAutoType")
daAutoCat.Fill(objDS, "dtAutoCat")
objConn.Close()
objDS.Relations.Add("AutoTypeToCat", objDS.Tables("dtAutoType").Columns("AutoId"), objDS.Tables("dtAutoCat").Columns("AutoId"))
Dim nodeAutoType, nodeAutoCat As TreeNode
Dim rowAutoType, rowAutoCat As DataRow
For Each rowAutoType In objDS.Tables("dtAutoType").Rows
nodeAutoType = New TreeNode
nodeAutoType.Text = rowAutoType("AutoType")
nodeAutoType.ID = rowAutoType("AutoId")
TreeView1.Nodes.Add(nodeAutoType)
TreeView1.EnableViewState = True
For Each rowAutoCat In rowAutoType.GetChildRows("AutoTypeToCat")
nodeAutoCat = New TreeNode
nodeAutoCat.ID = rowAutoCat("CatId")
nodeAutoCat.Text = rowAutoCat("CatName")
nodeAutoCat.NavigateUrl = "Index.aspx?CatId=" + Server.UrlEncode(CType(rowAutoCat("CatId"), String))
nodeAutoType.Nodes.Add(nodeAutoCat)
Next
Next
'clean up
objDS.Dispose()
daAutoType.Dispose()
daAutoCat.Dispose()
objConn.Close()
objConn.Dispose()
End If
End Sub
Private Sub TreeView1_SelectedIndexChange(ByVal sender As Object, ByVal e As Microsoft.Web.UI.WebControls.TreeViewSelectEventArgs) Handles TreeView1.SelectedIndexChange
'TreeView1.Nodes.Item("nodeAutoCat").Expanded() = True
Response.Write("I am here")
End Sub
---
|
|
|
|
|
Hi
I use a database with sql server 2000 , I deal with a tabel which has primary key ID which is auto number .
i create a stored procedure to isnert fields
i link the program with that stored procedure ,
as the normal you can't enter that field ID (auto number) ...
when i try to save record , the system error occured and told me that i didn't enter the ID field ....
i'm sorry to waste your time ,,,,
jooooo
|
|
|
|
|
You forgot to ask a question.
What is it that you are trying to do, what exactly have you tried, and what exactly happened? When you say that you tried to save a record, do you mean an insert or an update? What was the exact error message?
---
b { font-weight: normal; }
|
|
|
|
|
Hi
Really i's so glad to participation on this nice site,
thanks my friend Guffa ,
i found the soloution of it , I didn't want to waste your time ti dispripe it , it's along case of code ,
but thanks and keep in touch
jooooo
|
|
|
|
|
Hello every one
I am making quiz and i want to add background sound in project and i am using vb.net - 2003
any help
wating for help
thanks
|
|
|
|
|
There is no built in sound API in 2003, you can p/invoke PlaySound, or use Windows Media Player as a control.
Christian Graus - C++ MVP
|
|
|
|
|
Hello
Thanks for your rep.
Yes I agrey with you but can you please tell me how to do it,But before i tried with WMP so i add WMP in my project and tried it but it's not working so can you please tell me how
wating for your kind rep.
have a nice time
|
|
|
|
|
I can't answer this. 'I tried with WMP' tells me nothing. Given that both I, and countless others, use WMP in our code, it's obvious that 'it's not working' means you're doing it wrong. The tutorials on the web are easy enough to follow, but either way, if you don't post your code, I have no way of knowing what you're doing wrong.
Christian Graus - C++ MVP
|
|
|
|
|
|
kindman_nb wrote: System.Threading.Thread.Currentculture.....("here language name")
That line won't do anything, unless your code changes it's UI by checking the culture.
You want both UIs to be in use in the one app ? The most likely way to do this is to design the two UI's as controls and have them both coded to work on the one form. Then, just switch which control is visible.
Christian Graus - C++ MVP
|
|
|
|
|
Hi Graus
what you said , i'm already thinkig on it but to design two control with two language is difficult , not difficult on design but in the future developmente its' will be difficult ,,
i'm allready seeing some program use a different language ,
the design of two language on design mode is so ease ,
the first design the default language then , from the Language property design the other
This methos make the developing of the project is too easy ,
but i can't replace between them on the run mode ,,, every one told me that it's easy , but how ,,, i don't know
thanks Graus for your importance
jooooo
|
|
|
|
|
kindman_nb wrote: to design two control with two language is difficult
You're using two different languages ? What on earth for ? Oh, do you mean the two UIs are based on what language the user speaks ? The UI changes completely, or just the language used in the text ? If the UI is the same, but the wording is in a different language, then you need to build string tables per language and the code someone gave you before was on the right track.
Christian Graus - C++ MVP
|
|
|
|
|
|
>Can anyone tell me which skill set is used for PDA Programming?
>Which Languages r used? why?
>java or .NET which one is good?WHY?
>Any Link on Web talk about It ???
Mohamad A. Flefel
mflefel@hotmail.com
+962 79 5963865
C#.net & VB.net Developer
|
|
|
|
|
You can use the Compact .NET Framework for developing software for Windows Mobile based devices.
|
|
|
|
|
How can i create file that contains Text and Picture in it...
Please answer me... It will be a good app so i will give u one copy free!!! to all here...
|
|
|
|
|
FeRtoll wrote: It will be a good app so i will give u one copy free!!!
LOL !!!
The answer is, it's up to you. If you want to invent a file format, you can ( although I *think* RTF can embedd images, could be wrong on that one ). Just look in the System.IO namespace, probably a BinaryStream is what you want to use. You probably want to define tags ( no necessarily XML ), which tell you when you get to an image in the text, and how big it is. Then, the Bitmap constructor can take a stream, so the rest is easy.
Christian Graus - C++ MVP
|
|
|
|
|
If you're making your own new type of file, you are free to do it however you want. Basically every file has a header which contains information about the file before it gets to the actual data. Besides including specific information about the text and image you need to have some information in your header saying where your text starts and stops and where your image starts and stops in the data so when your program reads it, it knows what type of data it is.
If you are unsure what other info to include, I suggest looking on the internet for examples of image and text file formats, especially their header info to use as an example so you know what to include in your file.
|
|
|
|
|
in vb6 ,i want to scan the serial port ,whether any hardware is present or not.i don't which type of control i can use.
But i use msscomm and sysinfo control for the above project,
but i don't know which type of method used to scan.
so please help me.
thank you
|
|
|
|
|
You can't scan the serial port. You can send some information to the device, and see if it answers.
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
New to VB.net, doing an exercise from a book, I am getting a warning message @ below function. Warning message is
"function 'padquotes' does not return a value on all code paths. A null reference exception could occur @ runtime when the result is used"
getting similar warning messages on other fucntions also. How do i fix this problem.
Function padquotes(ByVal strin As String) As String
Try
padquotes = strin.Replace("'", "''")
Catch ex As Exception
'error handler done here
unhandledexceptionhandler()
End Try
End Function
|
|
|
|
|
Hi,
When you define a function that means that function should return a value. This return type is specified in the signature itself. In this case it is string.
Function padquotes(ByVal strin As String) As String<br />
Try<br />
padquotes = strin.Replace("'", "''")<br />
<br />
Catch ex As Exception<br />
'error handler done here<br />
unhandledexceptionhandler()<br />
<br />
End Try<br />
End Function
But what if an exception occurs? You have handeled it, but in that case what should be the output of the function ?
You should ideally return nothing or an empty string in this case.
change ur catch block to -
Catch ex As Exception
'error handler done here
unhandledexceptionhandler()
return nothing ' or return ""
End Try
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|