|
<asp:datalist id="DataList1" runat="server" datakeyfield="ProductID"
="" datasourceid="ObjectDataSource1" enableviewstate="False">
If there are 3 attributes key serve as the table's primary key. How can i put the DataKeyField with 3 attributes name?
Who can help me?.......please
THANKS
|
|
|
|
|
I have a question regarding the use of GridView or any other server controls that allows be to display and format data in the following manner?
row01 | row04 | row07
row02 | row05 | row08
row03 | row06 | row09
Possibly this is page 1 and page 2 will look like something...
row10 | row13 | row16
row11 | row14 | row17
row12 | row15 | row18
And so on...
The objective of doing this is because I want to maximize the use of the space on the right hand side if each record in the database I want to display is somewhat
short rather than using the default rendering behaviour that grows downwards after each record is displayed per line.
Is this doable using GridView, if yes can anyone advise me on how I should go about doing it or examples, tutorials I can be referred to. Or I have to use some other web control other than GridView? Repeater?
Thanks in advance.
|
|
|
|
|
I'd expect to use a repeater to define a layout like this. It's more flexible, the gridview is more powerful when you want one row per record.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
You can use DataList Server Control. You can set direction or no. of columns to display using the attribute RepeatDirection or RepeatColumns. Both are optional.
For eg.,
<code><asp:DataList id="DataList1" runat="server" RepeatDirection="Horizontal">
<ItemTemplate>
<table border=1>
<tr>
<td>
<%# DataBinder.Eval(Container.DataItem, "Au_ID") %>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</code>
Or, Check this link <a href="http://msdn2.microsoft.com/en-us/library/yfx4t9t7(VS.71).aspx">DataList Web Server Control</a>[<a href="http://msdn2.microsoft.com/en-us/library/yfx4t9t7(VS.71).aspx" target="_blank" title="New Window">^</a>]
Hope you got it.
Harini
|
|
|
|
|
hello everyone, sorry so long
ive got an entry form that users are allowed to post to a log with. the form contains a datalist of checkboxes that are flags to filter by. when a user clicks certain checkboxes a radiobuttonlist showing parameters is displayed within the item. the problem occuring on postback is that the checkboxes and radios go back to there original state and i would lose files added to the listbox from the previous post back. In order to get around this i create a session value of a small structure that i use as a basic entry template. the structure contains 2 string collections that are related to files and flags.
this method seems to work exactly as expected for the listbox control but i dont seem to be getting any of the values from my datalist added to the session value ie the flag collection retruns a count of zero.
here is where im adding the values from files and from flags
the for loop is the problem i suppose as the values for the file collection appear but none from the datalist
<br />
'skipping the bulk<br />
Dim str As String = ""<br />
str = smf.location0 & ","<br />
str &= smf.name1 & ","<br />
str &= smf.caption2 & ","<br />
str &= smf.type3 & ","<br />
str &= smf.id4.ToString<br />
smsg.StrFileCol.Add(str)<br />
Me.lblFileStatus.Text = "File added as " & smf.name1<br />
<br />
<br />
For Each itm As DataListItem In Me.dlFlags.Items<br />
Dim chkbx As CheckBox = CType(itm.FindControl("chkFlag"), CheckBox)<br />
Dim hdn As HiddenField = CType(itm.FindControl("hdnFlagId"), HiddenField)<br />
<br />
Dim rdos As RadioButtonList = CType(itm.FindControl("rdoparam"), RadioButtonList)<br />
Dim flgstr As String = ""<br />
If chkbx.Checked = True Then<br />
If Not (rdos.SelectedValue =-1) Then<br />
flgstr = hdn.Value & ","<br />
flgstr &= rdos.SelectedValue<br />
Else<br />
flgstr = hdn.Value & ","<br />
flgstr &= 0<br />
End If<br />
smsg.StrFlagCol.Add(flgstr)<br />
End If<br />
Next<br />
Session("smsg") = smsg<br />
'also trying Session.Item("smsg") = smsg but they seem equivalent<br />
End If<br />
<br />
<br />
Dim tempStr2 As String() = Split(gid, "-")<br />
If tempStr2.Length = 5 Then<br />
Me.lboxFileUpload.Items.Insert(0, litm)<br />
Else<br />
Me.lblFileStatus.Text = "Error Adding " & gid<br />
End If<br />
Else<br />
Me.lblFileStatus.Text = "Please specify a title"<br />
End If
i'm attempting to display this two different ways
the most obvious i thought would be
Protected Sub dlFlags_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles dlFlags.ItemDataBound<br />
<br />
Dim chk As CheckBox = CType(e.Item.FindControl("chkFlag"), CheckBox)<br />
Dim xDs As XmlDataSource = xmldsflagparams<br />
Dim hdn As HiddenField = CType(e.Item.FindControl("hdnFlagId"), HiddenField)<br />
Dim rdo As RadioButtonList = CType(e.Item.FindControl("rdoparam"), RadioButtonList)<br />
xDs.XPath = "//flag[@id='" & hdn.Value & "']//param"<br />
rdo.DataSourceID = ""<br />
rdo.DataSource = xDs<br />
rdo.DataBind()<br />
Dim spn As HtmlGenericControl = CType(e.Item.FindControl("radiolist"), HtmlGenericControl)<br />
For Each flag As String In smsg.StrFlagCol<br />
Dim strflag() As String = Split(flag, ",")<br />
If strflag(0) = hdn.Value Then<br />
chk.Checked = True<br />
End If<br />
If strflag(1) > 0 Then<br />
rdo.SelectedValue = strflag(1)<br />
spn.Style.Item("display") = "inline"<br />
End If<br />
Next<br />
Dim lbl As New Label<br />
'this always returns 0<br />
lbl.Text = smsg.StrFlagCol.Count<br />
e.Item.Controls.Add(lbl)<br />
End Sub
I would greatly appreciate any insight on this
werD, MCP
-- modified at 20:16 Wednesday 6th June, 2007
|
|
|
|
|
Odds are you bind to your data source in page load on postback ( sorry, this was too long for me to read it all ). this rests the control state and your viewstate is lost.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for you response
i got to trying this and it when i dont call databind on the datalist when its a postback it disappears. why is this? ive been binding and then trying to set these values checked or not with a session variable, but if this would work without that overhead i would be thrilled
werD, MCP
|
|
|
|
|
Hi all,
I have been searching for two weeks till now for any code or idea about how to download a CSV file that is online to a web page. I need to download the CSV file under finance.yahoo.com for any stock to an HTML page. I have been trying to find what is the best way to do that. Please help me and let me know if you have any ideas or if you can help me.
Thanks!
Best regards and many thanks
|
|
|
|
|
Which bit are you stuck with ? You need to download the file, and then parse it to build your table.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Well, that's a good question. I am stuck with opening the file to html page. Thanks for getting back so quickly. I appreciate your help.
Best regards and many thanks
|
|
|
|
|
Well, your page definately needs to be active, not just HTML, and it needs to parse out the file on the server, to create a table.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes, I know. I was trying to do that with ASP, but could not find any thing that can help me opening a CSV file from the web to another page that I will be creating. I need this file instead to prompt a message either to save it on the hard drive or to view the file, I need it to open right away as soon as the page loads. I need this to be done on the fly and to open in a browser.
Thanks again
Best regards and many thanks
|
|
|
|
|
hi
I am using asp.net2.0, Show progress bar when page load as indication.
plz Any budy help...
k.ravi sankar
|
|
|
|
|
priyaram1 wrote: plz Any budy help
read How to get an answer to your question
only two letters away from being an asset
|
|
|
|
|
|
hi friend
can u explain what it is?
Thank q
k.ravi sankar
|
|
|
|
|
the only way to have any page element visible while pages are loading is to use AJAX. It still won't work for the first page, by definition.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I think this user and suchon_phuong(who keeps posting gibberish) are the same user. Look at this users previous posts. They are titled in the same gibberish.
______________________
stuff + cats = awesome
|
|
|
|
|
hi
Thanks for u r's replay i got the solution simply write javascript in onsubmit event.
Thanq all
regards
ravi sankar,
Tecnics.
k.ravi sankar
|
|
|
|
|
how can i get the day name (sunday or monday or ..... etc) of the given date like 03/05/2007 ??
i want to know the day name of this date or any date in this format
|
|
|
|
|
System.Globalization.DateTimeFormatInfo.CurrentInfo.GetDayName(DateTime.Now.DayOfWeek);
... will give you the culture specific name of the current date.
|
|
|
|
|
Brady Kelly wrote: will give you the culture specific name of the current date.
He asked for a given date, not the current date
DateTime dt = DateTime.Parse("03/05/2007");
System.Globalization.DateTimeFormatInfo.CurrentInfo.GetDayName(dt.DayOfWeek)
only two letters away from being an asset
|
|
|
|
|
Yes, but I assumed his requirement was to find the name, not parse a date, and at least gave him credit for being able to apply the example to any date.
|
|
|
|
|
Hey all,
I wanted to get some recommendations for merchant account/gateway/shopping cart solutions for a Canadian based web store.
The store is pretty typical: <100 products, physical merchandise (hats, tshirts, toys, etc.), currently considering both manual and real time transaction processing.
I'd prefer the technology solution to be ASP.NET and C#.
Has anyone implemented a similar solution and would recommend their choice of vendor?
Thx
-- modified at 18:24 Wednesday 6th June, 2007
|
|
|
|
|
Currently I have a piece of code that uses the following method to dump a dataGrid table into an excel file, it basically takes the generated html code (i.e. the table, th, td and tr tags) of a dataGrid and send it to context.response.write, which can then be saved as an Excel readable format. (web format in excel)
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
dataGrid.RenderControl(hw)
Context.Response.Write(Now)
Context.Response.Write("<center><font size=3 face=Verdana color=#0000FF>" & S2LabelTitle.Text & "</font></center>")
Context.Response.Write(tw.ToString())
Context.Response.Flush()
Context.Response.Close()
Context.Response.End()
however, recently my task is to export a dataGrid with french characters in it. When they are exported to the file and read by excel, the french characters shows up as jubbrish.
Can I have some advice?
|
|
|
|