rg.MasterTableView.ClearEditItems(); rg.MasterTableView.IsItemInserted = false;
Thursday, 5 February 2015
Wednesday, 4 February 2015
Cannot get all rows from Rad Grid-View with DataPager
RadGrid1.AllowPagging = false;
RadGrid1.Rebind();
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
{
}
RadGrid1.AllowPagging = true;
RadGrid1.Rebind();
(or)
RadGrid1.MasterTableView.AllowPagging = false;
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
{
}
RadGrid1.MasterTableView.AllowPagging = true;
Tuesday, 6 January 2015
Add on drop event to a div javascript
You need to enable dropping on the target element. Add the ondragover attribute to your div like this:
<div id="bin" ondrop="drop(event)" ondragover="allowDrop(event)">
<img src="icono.png" style="width:100px; margin-left:500px;display:inline;"/><p>
</div>
and an allowDrop function such as this:
function allowDrop(e) {
e.preventDefault();
}
http://stackoverflow.com/questions/21999030/add-on-drop-event-to-a-div-no-jquery
Tuesday, 7 October 2014
How to extract pages from a PDF document using c# and itextsharp
private static void ExtractPages(string
inputFile, string
outputFile,
int start, int
end)
{
//
get input document
PdfReader inputPdf = new PdfReader(inputFile);
//
retrieve the total number of pages
int pageCount = inputPdf.NumberOfPages;
if (end < start || end > pageCount)
{
end = pageCount;
}
//
load the input document
Document inputDoc =
new Document(inputPdf.GetPageSizeWithRotation(1));
//
create the filestream
using (FileStream fs = new FileStream(outputFile, FileMode.Create))
{
//
create the output writer
PdfWriter outputWriter = PdfWriter.GetInstance(inputDoc,
fs);
inputDoc.Open();
PdfContentByte cb1 = outputWriter.DirectContent;
//
copy pages from input to output document
for (int i
= start; i <= end; i++)
{
inputDoc.SetPageSize(inputPdf.GetPageSizeWithRotation(i));
inputDoc.NewPage();
PdfImportedPage page =
outputWriter.GetImportedPage(inputPdf, i);
int rotation = inputPdf.GetPageRotation(i);
if (rotation == 90 || rotation == 270)
{
cb1.AddTemplate(page, 0, -1f,
1f, 0, 0,
inputPdf.GetPageSizeWithRotation(i).Height);
}
else
{
cb1.AddTemplate(page, 1f, 0, 0,
1f, 0, 0);
}
}
inputDoc.Close();
}
}
Ref:
Tuesday, 8 April 2014
An Error Occurred Setting Your User Cookie using Webclient
public class CookieAwareWebClient : WebClient { private CookieContainer m_container = new CookieContainer(); protected override WebRequest GetWebRequest(Uri address) { WebRequest request = base.GetWebRequest(address); if (request is HttpWebRequest) { (request as HttpWebRequest).CookieContainer = m_container; } return request; } }CookieAwareWebClient client = new CookieAwareWebClient();string page =client.DownloadString(hdnSelectedLink.Value);
Wednesday, 16 October 2013
how to disable focus on textbox
<asp:TextBox ID="TextBox1" runat="server" readonly="true" onfocus="this.blur();" ></asp:TextBox>
Monday, 9 September 2013
How to set the position of the ASP.NET Ajax ModalPopupExtender?
<AjaxToolkit:ModalPopupExtender
...otherproperties...
X="100" Y="300">
</AjaxToolkit:ModalPopupExtender>
Subscribe to:
Posts (Atom)