|
thanks for the quick reply
that seems to be a good approach. I tried implement it but it doesn't invoke the action when i click on the grid.
have i forgot something? (I enabled sorting)
|
|
|
|
|
all you have to do is, AllowSorting = "true" and then handle the "Sorting" event (OnSorting="GridView1_Sorting"). and then click on the column names (it should be appeared as links) at the run time.
|
|
|
|
|
|
I'm using OWC 11.0 in ASP.NET and C# to create excel file.
I need to protect/unprotect the sheet by a password. I tried to protect the sheet by following code.
string Password = "Password123";
object getPasswordFromUser =(object)Password;
xl.ActiveSheet.Protect(ref getPasswordFromUser, ref obj,
ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj,
ref obj, ref obj, ref obj, ref obj, ref objTrue, ref obj);
But it throws an exception "Exception from HRESULT: 0xE0040059"
Kindly help me to resolve this issue. Code works well if I miss the password.
|
|
|
|
|
Hi All
I am using paging in grid view
<br />
<asp:GridView ID="gridOrganizationDetails" runat="server" <br />
AutoGenerateColumns ="false" OnRowEditing ="gridOrganizationDetails_RowEditing"<br />
OnRowDeleting ="gridOrganizationDetails_RowDeleting" CellPadding="7" <br />
onrowcreated="gridOrganizationDetails_RowCreated" AllowPaging="True" <br />
PageSize="1"><br />
<RowStyle ForeColor="#000066" /><br />
<FooterStyle BackColor="White" ForeColor="#000066" /><br />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /><br />
<PagerSettings Mode="NextPrevious" /><br />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /><br />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /><br />
<AlternatingRowStyle BackColor="#ffffff" /><br />
<AlternatingRowStyle BackColor="#ffffff" /><br />
<Columns><br />
<asp:BoundField HeaderText="Id" Visible ="true" DataField ="pk" /> <br />
<asp:BoundField HeaderText="Organization Name" Visible ="true" DataField ="name" /> <br />
<asp:BoundField HeaderText="Address 1" Visible ="true" DataField ="address1" /> <br />
<asp:TemplateField HeaderText="Active"><br />
<ItemTemplate><%# DisplayActive((Byte)Eval("is_Active"))%></ItemTemplate><br />
</asp:TemplateField> <br />
<asp:CommandField ShowEditButton ="true" HeaderText ="Edit" <br />
HeaderStyle-HorizontalAlign ="Center" ItemStyle-HorizontalAlign ="Center" ><br />
<HeaderStyle HorizontalAlign="Center"></HeaderStyle><br />
<br />
<ItemStyle HorizontalAlign="Center"></ItemStyle><br />
</asp:CommandField><br />
</Columns><br />
</asp:GridView><br />
in this i am following 3 tier architecture from Page i m calling business logic
from UI
<br />
DataSet ds = myAction.GetOrganizationDetailsPaging(roleId, userId);<br />
<br />
gridOrganizationDetails.DataSource = ds;<br />
gridOrganizationDetails.DataBind();<br />
in second layer
if (roleId == Convert.ToInt32(UserRole.Admin))
{
query = "Select * from organization";
}
else
{
query = "select * from organization orga , user us where (orga.pk =us.org_fk) and us.role_fk ='" + roleId + "'" + "and (us.pk ='" + userId + "')";
}
DbAction dbConnector = new DbAction();
DataSet ds = new DataSet();
ds = dbConnector.ExecuteDataSet(query);
return ds;
from 3 layer i am returning the following thing
public DataSet ExecuteDataSet(String query)
{
DataSet ds = new DataSet();
MySqlDataAdapter adapter = new MySqlDataAdapter(query, ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
adapter.Fill(ds);
return ds;
}
if i m defiing page size 2 then only 2 record is coing and no paging option is coming
i am using My sql
thanks and regars
amit
|
|
|
|
|
According to me if paging option is not coming than only 2 record is returned form the database try to run query in query analyzer and see the result
if not than plz try to provide more info
|
|
|
|
|
Because you forgot to handle PageIndexChanging event of Grid View.
On that event you need to assign new page index to the gridview and then you need to bind the data set again.
i.e.
protected void gridOrganizationDetails_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gridOrganizationDetails.PageIndex = e.NewPageIndex;
ds =
gridOrganizationDetails.DataSource = ds;
gridOrganizationDetails.DataBind();
}
|
|
|
|
|
i checked from data base 10 record is coming.
and i also handle page index changing event
but still that footer is with record not coming.
|
|
|
|
|
I've already posted this on StackOverflow[^] but haven't seen much traffic yet...
I've got a web form (set in a master page) and want to check to see if the page has any changes before exiting (either by success or redirect). If any changes have been made, a dialog is displayed and the user can click ok or cancel.
I've created a panel to act as a dialog box (change z-layer, and apply shading and opacity to background) but my problem is in handling the click events from the buttons on the dialog. For a given exit scenario, I want to do something like:
protected void btnWelcomePage_Click(object sender, ImageClickEventArgs e)
{
if (this.HasChanges())
{
lblDialogTitle.Text = "Confirm Exit";
lblDialogMessage.Text = "Are you sure? Click OK to continue and lose any data entered";
ClearEventHandlers(btnDialogOK);
btnDialogOK_Click.Click += new EventHandler(btnDialogOK_Click);
ClearEventHandlers(btDialogCancel);
btnDialogCancel_Click += new EventHandler(btnDialogCancel_Click);
pnlDialog.Visible = true;
}
else
{
Response.Redirect("~/WelcomePage.aspx");
}
}
where the event handler for the buttons will do the appropriate work to hide the dialog and redirect if required.
My problem is that the EventHandler doesn't appear to bind between postbacks - setting a breakpoint in the Click event handler doesn't do anything; the page does an empty postback.
I assumed that the postback trashes the EventHandlers so I enabled ViewState on the buttons but to no avail. Can anyone suggest a model for handling this type of change? I've been searching through google but everything appears to relate to the dynamic creation of controls rather than the dynamic assignment of EventHandlers.
Thanks in advance
Dave
It definitely isn't definatley
|
|
|
|
|
try to bind event with control when change are there in prerender event of the page
hope this will work because code did by you is right it should work
|
|
|
|
|
to add controls (with eventhandlers) on pageweb you have to add it on page-init.
try this:
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
lblDialogTitle.Text = "Confirm Exit";
lblDialogMessage.Text = "Are you sure? Click OK to continue and lose any data entered";
ClearEventHandlers(btnDialogOK);
btnDialogOK_Click.Click += new EventHandler(btnDialogOK_Click);
ClearEventHandlers(btDialogCancel);
btnDialogCancel_Click += new EventHandler(btnDialogCancel_Click);
}
protected void btnWelcomePage_Click(object sender, ImageClickEventArgs e)
{
if (this.HasChanges())
{
pnlDialog.Visible = true;
}
else
{
Response.Redirect("~/WelcomePage.aspx");
}
}
good luck
Mehdi
|
|
|
|
|
How to detect thread end,
Actually i want to give a message to the user after thread ends
|
|
|
|
|
i gr8 wrote: detect thread end
Which thread? Are you creating any new thread?
Can you please explain in detail?
"Never put off until run time what you can do at compile time."
- David Gries, in "Compiler Construction for Digital Computers", circa 1969.
|
|
|
|
|
if u creating Thread using Delegate then u child thread returns IAsyncResult which can we use to determinr whether thread is completed or not
|
|
|
|
|
|
Hi,
need a solution when i browse for 1 file in IE it returns the full path but in mozilla it returns only a file name
Thanks
www.myzonal.com
|
|
|
|
|
Hi
Not sure what code you are using, but you can try by using below tag
<input id="flExcel" runat="server" class="txt" style="width: 392px; height: 20px"<br />
type="file" unselectable="on" />
Regards
Naina
Naina
|
|
|
|
|
How to Call webservice of Yahoo to get the Contact list..
I have created the Application ID and i am able to get the token value..
I need help to get the Webservice Session ID (wssid) to call webservice..
the code is as follows:
Dim auth As New Yahoo.Authentication("XXXXXXXXX-", "XXXXXXXXXX")
Session("Auth") = auth
Dim success As Boolean = False
If Not Session("Auth") Is Nothing Then
auth = DirectCast(Session("Auth"), Yahoo.Authentication)
End If
If (Not Request.QueryString("token") Is Nothing) _
AndAlso Request.QueryString("token").Length > 0 Then
' Make sure the call is valid
If auth.IsValidSignedUrl(Request.Url) = True Then
success = True
' Save the user token. It is valid for two weeks
auth.Token = Request.QueryString("token")
|
|
|
|
|
Hi,
How to create a StackedBar100 chart using microsoft chart control.
Thankyou
YPKI
|
|
|
|
|
Hi everyone,
How can i convert excel spreadsheet (xls file) to XSL:FO, in asp.net
Thanks,
Venkat
Venky
|
|
|
|
|
Hi To all forum members,
I have a search button which search records in the form, then I have to call a java script which return some values, on the base of these values I have I Have to populate Grid View.
Actually
when I clicked on search button
I) It hits to database and takes records and
II) These records are passed to java script
III) Then java script returns a value location.
On the base of java script values and code behind search criteria values i Have to populate grid view.
I am using asp.net and c# technology.
How can achieve all three steps by single click of search button.
Even i am unable to populate grid on form refresh from that java script code.
All three steps I have to perform in Single click on Search button.
I achieved this but I have to click search button twice.
Vishnu Narayan Mishra
Software Engineer
modified on Thursday, January 21, 2010 1:53 AM
|
|
|
|
|
Why do you want to roundtrip?Why dont you try to simulate the javascript thing in c# itself?it'll also improve the performance.
Cheers!!
Brij
|
|
|
|
|
if you want to do this thing in one go than only one solution is there
use ajax mecanism for that or use jquery ajax which work for you easily in javasript.
|
|
|
|
|
how to shape a gridview in ASP.net (C# Coding ) same as Forum.
I wanna to have forum with GridView.(but with all other Forum Shape)
|
|
|
|
|
Notbody is here to write code for you.Use google try by yourself if face any specific issues,Post here.
Cheers!!
Brij
|
|
|
|