|
I only need to show them one or two Columns.
|
|
|
|
|
Hi,
Use gridview BoundField like this:
<asp:gridview>
<columns>
<asp:boundfield>
AccessibleHeaderText="string"
ApplyFormatInEditMode="True|False"
ConvertEmptyStringToNull="True|False"
DataField="string"
DataFormatString="string"
FooterText="string"
HeaderImageUrl="uri"
HeaderText="string"
HtmlEncode="True|False"
InsertVisible="True|False"
NullDisplayText="string"
ReadOnly="True|False"
ShowHeader="True|False"
SortExpression="string" Visible="True|False></asp:boundfield></columns></asp:gridview>
Set BoundFields then bound grid view with your data table such as previous reply shown.
|
|
|
|
|
I need to create an output file (.txt), but I need to manipulate the data in that file. I need to add “hard-coded” values for specific scenarios, for example, value[15] needs to have a value in it but is “ “ in the output file because it doesn’t exist in the database. This needs to be automated because a user will click a download output file button and the file will ultimately be saved on their client machine. I assume anything can be done, but is there a good web site with examples of this that you could point me to? Thanks for any help you can give.
|
|
|
|
|
You just build your text in memory, then you use response.binarywrite and set the header so they get the file as a download.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
I am using the regular technique of using a 2nd TextBox on my page so when the user presses Enter key, it automatically invokes the Submit buttons click event - but its not working. I also want to send the focus to the textbox when a link is clicked that displays this whole panel. Here's my code:
<br />
<asp:Panel ID="pnlSearch" runat="server" CssClass="pnlsearch"><br />
<asp:Label ID="lblSearch" runat="server" Text="Station Name:" CssClass="lblsearch"<br />
TabIndex="0"></asp:Label><br />
<asp:TextBox ID="txtSearch" runat="server" CssClass="txtsearch" Width="190px" TabIndex="1"<br />
OnTextChanged="txtSearch_TextChanged"></asp:TextBox><br />
<asp:TextBox ID="TextBox1" runat="server" style="visibility:hidden;display:none;" /><br />
<asp:Button ID="btnSearch" runat="server" CssClass="btnsearch" Text="Search" Width="79px" <br />
TabIndex="2" OnClick="btnSearch_Click" /><br />
</asp:Panel><br />
protected void lnkSearch_Click(object sender, EventArgs e)<br />
{<br />
pnlSearch.Visible = !pnlSearch.Visible;<br />
if (pnlSearch.Visible == true)<br />
{<br />
txtSearch.Focus();<br />
}<br />
}<br />
protected void txtSearch_TextChanged(object sender, EventArgs e)<br />
{<br />
btnSearch.Focus();<br />
}<br />
Any help?
Thanks.
Ekjon
|
|
|
|
|
To use a button as the default button for a textbox or group or textboxes, get all the textboxes inside a panel and set the defaultbutton of the panel to the button you need as default
Alexei Rodriguez
|
|
|
|
|
Thanks Alexei for the TextBox tip. But how do I send the focus to the TextBox? Why the Focus() method doesn't work?
Regards
Ekjon
|
|
|
|
|
Set the defaultfocus of the form to the TextBox you want to receive focus
Form.DefaultFocus = "TextBoxName"
If you always want to set the focus to the same control, you can set this property during design time
Alexei Rodriguez
|
|
|
|
|
Hi,
I tried both Page.SetFocus(..) and Form.DefaultFocus = ..
They work fine, the problem is: I have a LinkButton that shows and hides the panel. The focus works if the panel is initially visible - then if the link is clicked to hide it, the focus doesn't come back when the panel is visible again.
On the other hand, if the panel is not initially visible - then the focus never works. Here's my code, the first one in the Page Load:
<br />
if (Page.IsPostBack)<br />
{<br />
if (pnlSearch.Visible == true)<br />
{<br />
Page.SetFocus(txtSearch);<br />
}<br />
}<br />
protected void lnkSearch_Click(object sender, EventArgs e)<br />
{<br />
pnlSearch.Visible = !pnlSearch.Visible;<br />
if (pnlSearch.Visible == true)<br />
{<br />
Page.SetFocus(txtSearch); <br />
}<br />
}
Part of the problem could be - I am using AJAX's UpdatePanel.
I am embarrassed to ask these trivial questions.
Ekjon
|
|
|
|
|
After creating the following menu I would like menuitem2 to be a sub menu of menuitem1. As the code is now both menu items are at the same level. How do I make menuitem2 a sub menu of menuitem1?
Dim menuitem1 As New MenuItem("Main topic")
Dim menuitem2 As New MenuItem(Sub topic")
Me.Menu1.Items.AddAt(0, menuitem1)
Me.Menu1.Items.AddAt(1, menuitem2)
|
|
|
|
|
Hi,
Do like this:
<br />
Dim menuitem1 As New MenuItem("Main topic")<br />
Dim menuitem2 As New MenuItem(Sub topic")<br />
<br />
menuitem1.ChildItems.Add(menuitem2)<br />
Me.Menu1.Items.AddAt(0, menuitem1)<br />
<br />
|
|
|
|
|
|
I am working on a project where I need to make a personality profiling application. Are there any examples out there that I can benefit from?
Like I need to ask several questions and somehow come up with a personality profile very similar to things seen on dating websites etc.
Also if there are any 3rd party components for personality profile then I can try to sell it to my boss (not sure if he will buy into that) it doesn’t hurt to try
Thanks.
|
|
|
|
|
Taurian110 wrote: Also if there are any 3rd party components for personality profile then I can try to sell it to my boss (not sure if he will buy into that) it doesn’t hurt to tr
Avoid posting official problems
Is Google working at your side ?
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Yes of course I googled it Haven't had any luck so far with .net components or examples, maybe I am not using the right keywords to search for it, who knows.
To me it’s more like a task for a Psychology student to come up with questions and answers and some formula to give a personality profile, its just funny to me that I am asked to do it lol.
But you would think it would be pretty trivial to have examples for stuff like that since its so common in community type websites.
|
|
|
|
|
Hi,
Due to various limitation i need to be able to change the format of dates in a SQl2005 db from DD/MM/YYYY to YYYY/MM/DD. Ideally this should be a stored proceedure.
Any help would as always be very greatfully received.
Thanks in advance.
Phill
|
|
|
|
|
Are you talking about updating the date format the way it is stored in the database? Or when you are retrieving it?
Also what is the data type of your date column is it varchar or DateTime?
If you just want to change the date format when retrieving the data then something like this will work:
SELECT
Convert(varchar, DATEPART(yyyy, UploadDate)) + '/' +
Convert(varchar, DATEPART(mm, UploadDate)) + '/' +
Convert(varchar, DATEPART(dd, UploadDate)) as MyNewFormat
FROM
dbo.[MytableName]
*Change the MytableName to your table and UploadeDate to your column name
hth
|
|
|
|
|
select convert(varchar,columnname,111) from myTable
I Love T-SQL
|
|
|
|
|
Its throwing up an OleDbException:
'Undefined function 'Convert' in expression.'
Any ideas?
|
|
|
|
|
Are you using SQL Server database or MS Access database?
I Love T-SQL
|
|
|
|
|
SQL 2005
Although im trying to do the convert on when uploading an Excel sheet to SQL2005 using BulkCopy.
See below:
<code>protected void Page_Load(object sender, EventArgs e)
{
// Connection String to Excel Workbook
//string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=BLAH\qs_upload.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=BLAH\qs_upload.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
// Create Connection to Excel Workbook
using (OleDbConnection connection = new OleDbConnection(excelConnectionString))
{
OleDbCommand command = new OleDbCommand("Select * FROM [quality_standard$]", connection);
//OleDbCommand command = new OleDbCommand("Select qs_Id, qs_Organisation, Convert(varchar,qs_Start,111), qs_End FROM [quality_standard$]", connection);
connection.Open();
// Create DbDataReader to Data Worksheet
using (OleDbDataReader dr = command.ExecuteReader())
{
// SQL Server Connection String
string sqlConnectionString = "REMOVED"
// Bulk Copy to SQL Server
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sqlConnectionString))
{
bulkCopy.DestinationTableName = "tbl_QualityStandard";
bulkCopy.WriteToServer(dr);
}
}
}
}</code>
|
|
|
|
|
Hi,
I have an aspx page that contains a control1, which contains another control (I call it, control2). My control2 contains a div (chartdiv) inside other div (chart). My chartdiv displays a graphic (everything done by Javascript) and onclick of the graphic I want to display other page. For that I put my graphic div (which is, chartdiv) inside other div (which is, chart) that allows to me click and open a new page. But my chart is always aligned to right and its not 100% correctly sized. Here is my code that I was refering:
control2 code:
The chart will appear within this DIV. This text will be replaced by the chart.
code behind code:
string IframeSrc = _urlHelper.HandleRootOperator("~/frm_statistic.aspx") + "?pubId=" + _pubId;
chart.Attributes.Add("onclick", "callLinksPage('" + IframeSrc + "','" + "Detailed Statistics for:"+this.State.PublicationTitle + "','760','570');");
Can anyone tell me can't I click my grpahic and open a new page? Is my code works ? or Is there other way to do this.
Thanks.
|
|
|
|
|
It will be helpfull if you right click ur page and copy and paste the HTML so we can see how the page is being rendered.
|
|
|
|
|
Complete Traffic Statistic
|
function LoadChart()
{
//alert(DataLink)
var myChart = new FusionCharts(ChartLink, "myChartId", "198", "135", "0", "0");
myChart.setDataURL(escape(DataLink));
myChart.render("chartdiv");
}
function getTimeForURL()
{
var dt = new Date();
var strOutput = "";
strOutput = dt.getHours() + "_" + dt.getMinutes() + "_" + dt.getSeconds() + "_" + dt.getMilliseconds();
return strOutput;
}
The chart will appear within this DIV. This text will be replaced by the chart.
LoadChart()
|
|
|
|
|
|
|
I dont see the html tags i think its blocked by the editor. When you are posting HTML tags there is an option below the editor "Ignore HTML tags in this message (good for code snippets)" I think if you click that, it will allow you to post the HTML source code.
HTH
|
|
|
|